diff --git a/package-lock.json b/package-lock.json
index 15a008a..637a0ef 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "coryd.dev",
- "version": "8.0.4",
+ "version": "8.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
- "version": "8.0.4",
+ "version": "8.1.4",
"license": "MIT",
"dependencies": {
"minisearch": "^7.1.2",
diff --git a/package.json b/package.json
index 718d58d..1c12f46 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "coryd.dev",
- "version": "8.0.4",
+ "version": "8.1.4",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {
diff --git a/src/pages/static/search.html b/src/pages/static/search.html
index ad49127..b486a13 100644
--- a/src/pages/static/search.html
+++ b/src/pages/static/search.html
@@ -84,7 +84,8 @@ description: Search through posts and other content on my site.
searchOptions: {
fields: ["title", "tags"],
prefix: true,
- fuzzy: 0.1,
+ fuzzy: 0.3,
+ combineWith: "OR",
boost: { title: 5, tags: 2, description: 1 },
},
});
@@ -94,12 +95,11 @@ description: Search through posts and other content on my site.
const $input = document.querySelector(".search__form--input");
const $results = document.querySelector(".search__results");
const $loadMoreButton = document.querySelector(".search__load-more");
- const $typeCheckboxes = document.querySelectorAll(
- '.search__form--type input[type="checkbox"]',
- );
+ const $typeCheckboxes = document.querySelectorAll('.search__form--type input[type="checkbox"]');
$form.removeAttribute("action");
$form.removeAttribute("method");
+
if ($fallback) $fallback.remove();
const PAGE_SIZE = 10;
@@ -107,7 +107,7 @@ description: Search through posts and other content on my site.
let currentResults = [];
let total = 0;
let debounceTimeout;
-
+ let isLoading = false;
const parseMarkdown = (markdown) =>
markdown
? markdown
@@ -117,7 +117,6 @@ description: Search through posts and other content on my site.
.replace(/\n/g, "
")
.replace(/[#*_~`]/g, "")
: "";
-
const truncateDescription = (markdown, maxLength = 225) => {
const plainText =
new DOMParser().parseFromString(parseMarkdown(markdown), "text/html")
@@ -126,12 +125,29 @@ description: Search through posts and other content on my site.
? `${plainText.substring(0, maxLength)}...`
: plainText;
};
-
const renderSearchResults = (results) => {
const resultHTML = results
.map(
({ title, url, description, type, total_plays }) => `
-
${truncateDescription(description)}
+${truncateDescription(description)}
-${truncateDescription(description)}
+ + `, ) .join(""); - - $results.innerHTML = - resultHTML || - '${truncateDescription(description)}
-