fix: drop unused search text

This commit is contained in:
Cory Dransfeldt 2024-03-21 10:45:31 -07:00
parent e9c08c1a90
commit ed560d1bfe
No known key found for this signature in database
3 changed files with 3 additions and 5 deletions

View file

@ -15,7 +15,6 @@ export const searchIndex = (collection) => {
id, id,
url, url,
title: `📝: ${post.data.title}`, title: `📝: ${post.data.title}`,
text: post.data.description,
tags: post.data.tags.filter((tag) => tag !== 'posts'), tags: post.data.tags.filter((tag) => tag !== 'posts'),
}) })
id++; id++;
@ -27,7 +26,6 @@ export const searchIndex = (collection) => {
id, id,
url: link.url, url: link.url,
title: `🔗: ${link.title}`, title: `🔗: ${link.title}`,
text: link.summary,
tags: link.tags, tags: link.tags,
}) })
id++; id++;

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "8.4.1", "version": "8.4.2",
"description": "The source for my personal site. Built using 11ty.", "description": "The source for my personal site. Built using 11ty.",
"type": "module", "type": "module",
"scripts": { "scripts": {

View file

@ -16,7 +16,7 @@
let resultsById = {} let resultsById = {}
// fetch index // fetch index
const results = fetch('/api/search').then(response => response.json()) fetch('/api/search').then(response => response.json())
.then((results) => { .then((results) => {
resultsById = results.reduce((byId, result) => { resultsById = results.reduce((byId, result) => {
byId[result.id] = result byId[result.id] = result
@ -25,7 +25,7 @@
return miniSearch.addAll(results) return miniSearch.addAll(results)
}) })
$input.addEventListener('input', (event) => { $input.addEventListener('input', () => {
const query = $input.value const query = $input.value
const results = (query.length > 1) ? getSearchResults(query) : [] const results = (query.length > 1) ? getSearchResults(query) : []
if (query === '') renderSearchResults([]) if (query === '') renderSearchResults([])