mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add Labels for sections
This commit is contained in:
parent
a7b5054dbc
commit
ec0c8f6b79
2 changed files with 16 additions and 11 deletions
|
|
@ -149,7 +149,7 @@ export default {
|
||||||
// results: [],
|
// results: [],
|
||||||
titleStartsWithResults: [],
|
titleStartsWithResults: [],
|
||||||
titleContainsResults: [],
|
titleContainsResults: [],
|
||||||
sectionNameContainsResults: [],
|
sectionContainsResults: [],
|
||||||
// store: overlayStore.state
|
// store: overlayStore.state
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -160,7 +160,7 @@ export default {
|
||||||
return [
|
return [
|
||||||
...this.titleStartsWithResults,
|
...this.titleStartsWithResults,
|
||||||
...this.titleContainsResults,
|
...this.titleContainsResults,
|
||||||
...this.sectionNameContainsResults
|
...this.sectionContainsResults
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
hasSearchInputText () {
|
hasSearchInputText () {
|
||||||
|
|
@ -198,10 +198,10 @@ export default {
|
||||||
}
|
}
|
||||||
return matches
|
return matches
|
||||||
},
|
},
|
||||||
sectionNameContains (query, app) {
|
sectionContains (query, app) {
|
||||||
const matches = app.sectionName.toLowerCase().includes(query)
|
const matches = app.section.label.toLowerCase().includes(query)
|
||||||
if (matches) {
|
if (matches) {
|
||||||
this.sectionNameContainsResults.push(app)
|
this.sectionContainsResults.push(app)
|
||||||
}
|
}
|
||||||
return matches
|
return matches
|
||||||
},
|
},
|
||||||
|
|
@ -239,7 +239,7 @@ export default {
|
||||||
const matchers = [
|
const matchers = [
|
||||||
this.titleStartsWith,
|
this.titleStartsWith,
|
||||||
this.titleContains,
|
this.titleContains,
|
||||||
this.sectionNameContains
|
this.sectionContains
|
||||||
]
|
]
|
||||||
|
|
||||||
// Run through our search priorities
|
// Run through our search priorities
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ export default async function () {
|
||||||
|
|
||||||
const appList = []
|
const appList = []
|
||||||
|
|
||||||
let sectionName = 'start'
|
let sectionSlug = 'start'
|
||||||
|
let sectionTitle = 'Start'
|
||||||
let isHeading = false
|
let isHeading = false
|
||||||
let isParagraph = false
|
let isParagraph = false
|
||||||
|
|
||||||
|
|
@ -77,11 +78,12 @@ export default async function () {
|
||||||
|
|
||||||
|
|
||||||
if (isHeading && token.type === 'inline') {
|
if (isHeading && token.type === 'inline') {
|
||||||
sectionName = slugify(token.content, {
|
sectionTitle = token.content
|
||||||
|
sectionSlug = slugify(token.content, {
|
||||||
lower: true
|
lower: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// appList[sectionName] = []
|
// appList[sectionSlug] = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -101,13 +103,16 @@ export default async function () {
|
||||||
url,
|
url,
|
||||||
text,
|
text,
|
||||||
slug: appSlug,
|
slug: appSlug,
|
||||||
sectionName,
|
section: {
|
||||||
|
label: sectionTitle,
|
||||||
|
slug: sectionSlug
|
||||||
|
},
|
||||||
content: token.content,
|
content: token.content,
|
||||||
relatedLinks
|
relatedLinks
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// appList[sectionName]
|
// appList[sectionSlug]
|
||||||
|
|
||||||
|
|
||||||
// console.log('token', token)
|
// console.log('token', token)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue