chore: search cleanup

This commit is contained in:
Cory Dransfeldt 2024-10-19 18:05:39 -07:00
parent be2d74bfd7
commit 71eaab3a36
No known key found for this signature in database
3 changed files with 19 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "1.5.7", "version": "1.5.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "1.5.7", "version": "1.5.8",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@cdransf/api-text": "^1.5.0", "@cdransf/api-text": "^1.5.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "1.5.7", "version": "1.5.8",
"description": "The source for my personal site. Built using 11ty (and other tools).", "description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module", "type": "module",
"engines": { "engines": {

View file

@ -96,6 +96,21 @@ window.addEventListener("load", () => {
const miniSearch = new MiniSearch({ const miniSearch = new MiniSearch({
fields: ["title", "description", "tags", "type"], fields: ["title", "description", "tags", "type"],
idField: "id",
storeFields: [
"id",
"title",
"url",
"description",
"type",
"tags",
"total_plays",
],
searchOptions: {
boost: { title: 2, tags: 1.5 },
prefix: true,
fuzzy: 0.3,
},
}); });
const $form = document.querySelector(".search__form"); const $form = document.querySelector(".search__form");
const $input = document.querySelector(".search__form--input"); const $input = document.querySelector(".search__form--input");