From ab0db31a3617e604dde16357fa751b92d67f9edf Mon Sep 17 00:00:00 2001 From: Owen Jones Date: Fri, 8 Nov 2024 16:33:07 +0000 Subject: [PATCH] Reformat search results metadata to be more verbose --- lib/metalsmith-lunr-index/index.js | 8 ++------ src/stylesheets/components/_site-search.scss | 6 ------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/metalsmith-lunr-index/index.js b/lib/metalsmith-lunr-index/index.js index fe1e7d0f4d..cbd191b389 100644 --- a/lib/metalsmith-lunr-index/index.js +++ b/lib/metalsmith-lunr-index/index.js @@ -5,10 +5,6 @@ const navigationConfig = require('../../config/navigation') module.exports = function lunrPlugin() { return (files, metalsmith, done) => { const outputPath = 'search-index.json' - - const separator = - '' - const includedSections = navigationConfig .filter((section) => !section.ignoreInSearch) .map((section) => section.label) @@ -88,7 +84,7 @@ module.exports = function lunrPlugin() { store[doc.permalink] = { permalink: doc.permalink, title: doc.title, - section: doc.section, + section: `in ${doc.section}`, aliases: doc.aliases } this.add(doc) @@ -98,7 +94,7 @@ module.exports = function lunrPlugin() { store[doc.permalink] = { permalink: doc.permalink, title: doc.title, - section: `${doc.section}${separator}${doc.page}`, + section: `part of ${doc.page} in ${doc.section}`, aliases: doc.aliases } this.add(doc) diff --git a/src/stylesheets/components/_site-search.scss b/src/stylesheets/components/_site-search.scss index cf0c231876..b963d363c7 100644 --- a/src/stylesheets/components/_site-search.scss +++ b/src/stylesheets/components/_site-search.scss @@ -303,9 +303,3 @@ $icon-size: 40px; content: ")"; } } - -.app-site-search__separator { - display: inline-block; - margin-right: govuk-spacing(1); - margin-left: govuk-spacing(1); -}