From 422ff69f5c6c1ad6ef5de52606d801bfbda42303 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 8 Nov 2024 22:54:49 -0800 Subject: [PATCH] Added date key to the search index for filtering. [Closes #3] --- scripts/make-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make-data.js b/scripts/make-data.js index 273cc6f..15b9ece 100644 --- a/scripts/make-data.js +++ b/scripts/make-data.js @@ -21,9 +21,9 @@ function getData () { } function makeIndex (category) { - const data = category.content.map(({ index, title, description = '', tags = [], category = '' }) => ({ + const data = category.content.map(({ index, title, description = '', tags = [], date, category = '' }) => ({ ref: index, - data: `${title} ${description} ${tags.join(' ')} ${category}` + data: `${title} ${description} ${tags.join(' ')} ${date} ${category}` })) category.index = lunr(function () {