diff --git a/components/search.vue b/components/search.vue index 61fac69..cb61c6a 100644 --- a/components/search.vue +++ b/components/search.vue @@ -149,7 +149,7 @@ export default { // results: [], titleStartsWithResults: [], titleContainsResults: [], - sectionNameContainsResults: [], + sectionContainsResults: [], // store: overlayStore.state } }, @@ -160,7 +160,7 @@ export default { return [ ...this.titleStartsWithResults, ...this.titleContainsResults, - ...this.sectionNameContainsResults + ...this.sectionContainsResults ] }, hasSearchInputText () { @@ -198,10 +198,10 @@ export default { } return matches }, - sectionNameContains (query, app) { - const matches = app.sectionName.toLowerCase().includes(query) + sectionContains (query, app) { + const matches = app.section.label.toLowerCase().includes(query) if (matches) { - this.sectionNameContainsResults.push(app) + this.sectionContainsResults.push(app) } return matches }, @@ -239,7 +239,7 @@ export default { const matchers = [ this.titleStartsWith, this.titleContains, - this.sectionNameContains + this.sectionContains ] // Run through our search priorities diff --git a/helpers/build-app-list.js b/helpers/build-app-list.js index e58b7ba..12a4a5f 100644 --- a/helpers/build-app-list.js +++ b/helpers/build-app-list.js @@ -63,7 +63,8 @@ export default async function () { const appList = [] - let sectionName = 'start' + let sectionSlug = 'start' + let sectionTitle = 'Start' let isHeading = false let isParagraph = false @@ -77,11 +78,12 @@ export default async function () { if (isHeading && token.type === 'inline') { - sectionName = slugify(token.content, { + sectionTitle = token.content + sectionSlug = slugify(token.content, { lower: true }) - // appList[sectionName] = [] + // appList[sectionSlug] = [] } @@ -101,13 +103,16 @@ export default async function () { url, text, slug: appSlug, - sectionName, + section: { + label: sectionTitle, + slug: sectionSlug + }, content: token.content, relatedLinks }) } - // appList[sectionName] + // appList[sectionSlug] // console.log('token', token)