diff --git a/src/routes/search.json.js b/src/routes/search.json.js index c730cae..b077c4f 100644 --- a/src/routes/search.json.js +++ b/src/routes/search.json.js @@ -8,10 +8,10 @@ function removeHTML(s) { async function convertForIdx(type, fields = []) { const items = await getAll(type) - const defaults = ['title', 'content', 'slug'] + const keys = ['title', 'content', 'slug', ...fields] return items.map((item) => ({ url: `${item.type}/${item.slug}`, - data: [...defaults, ...fields].map((field) => removeHTML(item[field])).join(' '), + data: keys.map((field) => removeHTML(item[field])).join(' '), })) } diff --git a/src/routes/search.svelte b/src/routes/search.svelte index 7b1ca95..698c867 100644 --- a/src/routes/search.svelte +++ b/src/routes/search.svelte @@ -1,22 +1,23 @@