aboutsummaryrefslogtreecommitdiff
path: root/make-search-index.js
diff options
context:
space:
mode:
Diffstat (limited to 'make-search-index.js')
-rw-r--r--make-search-index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/make-search-index.js b/make-search-index.js
index bb92b68..0690dae 100644
--- a/make-search-index.js
+++ b/make-search-index.js
@@ -3,8 +3,8 @@
* make-search-index.js
*
* This converts a "search data" file produced by the haskell site builder into
- * a lunr.js index and saves it in JSON. Metadata for search (currently titles)
- * are stored separately in an extra file.
+ * a lunr.js index and saves it in JSON. Metadata for rendering search output
+ * (currently titles and tags) are stored separately in an extra file.
*
* Installing dependencies:
* yarnpkg add lunr
@@ -35,5 +35,5 @@ var idx = lunr(function () {
fs.writeFileSync(process.argv[3], JSON.stringify(idx), {encoding: 'utf8'})
fs.writeFileSync(process.argv[4], JSON.stringify(
- Object.fromEntries(documents.map(x => [x.link, x.title]))
+ Object.fromEntries(documents.map(x => [x.link, {"title": x.title, "tags": x.tags}]))
), {encoding: 'utf8'})