From ed560d1bfef33bcb26f0eb568d124a3587401075 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Thu, 21 Mar 2024 10:45:31 -0700 Subject: [PATCH] fix: drop unused search text --- config/collections/index.js | 2 -- package.json | 2 +- src/assets/scripts/search.js | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/collections/index.js b/config/collections/index.js index a0b1fb8b..5048f759 100644 --- a/config/collections/index.js +++ b/config/collections/index.js @@ -15,7 +15,6 @@ export const searchIndex = (collection) => { id, url, title: `📝: ${post.data.title}`, - text: post.data.description, tags: post.data.tags.filter((tag) => tag !== 'posts'), }) id++; @@ -27,7 +26,6 @@ export const searchIndex = (collection) => { id, url: link.url, title: `🔗: ${link.title}`, - text: link.summary, tags: link.tags, }) id++; diff --git a/package.json b/package.json index ffa4d7ee..09106897 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "8.4.1", + "version": "8.4.2", "description": "The source for my personal site. Built using 11ty.", "type": "module", "scripts": { diff --git a/src/assets/scripts/search.js b/src/assets/scripts/search.js index c575f821..247860fb 100644 --- a/src/assets/scripts/search.js +++ b/src/assets/scripts/search.js @@ -16,7 +16,7 @@ let resultsById = {} // fetch index - const results = fetch('/api/search').then(response => response.json()) + fetch('/api/search').then(response => response.json()) .then((results) => { resultsById = results.reduce((byId, result) => { byId[result.id] = result @@ -25,7 +25,7 @@ return miniSearch.addAll(results) }) - $input.addEventListener('input', (event) => { + $input.addEventListener('input', () => { const query = $input.value const results = (query.length > 1) ? getSearchResults(query) : [] if (query === '') renderSearchResults([])