From 19d17f70d2c3bac8293ded8f09fac99097edd9dd Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 19 Oct 2024 20:32:54 -0700 Subject: [PATCH] chore: search cleanup --- package-lock.json | 4 ++-- package.json | 2 +- src/assets/scripts/index.js | 11 +---------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b1fc7e8d..adcb1cf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "1.5.15", + "version": "1.5.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "1.5.15", + "version": "1.5.16", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", diff --git a/package.json b/package.json index acc9c883..0124ac7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "1.5.15", + "version": "1.5.16", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "engines": { diff --git a/src/assets/scripts/index.js b/src/assets/scripts/index.js index 41d0e8f0..06dcf7e3 100644 --- a/src/assets/scripts/index.js +++ b/src/assets/scripts/index.js @@ -110,16 +110,7 @@ window.addEventListener("load", () => { fields: ["title", "tags"], prefix: true, fuzzy: 0.1, - boost: { title: 5, tags: 2 }, - sort: (a, b) => { - const exactMatchA = - a.title.toLowerCase() === $input.value.trim().toLowerCase(); - const exactMatchB = - b.title.toLowerCase() === $input.value.trim().toLowerCase(); - if (exactMatchA && !exactMatchB) return -1; - if (!exactMatchA && exactMatchB) return 1; - return b.score - a.score; - }, + boost: { title: 5, tags: 2, description: 1 }, }, }); const $form = document.querySelector(".search__form");