This commit is contained in:
ryfrd 2025-08-20 15:19:24 +01:00
parent 2a9167cb7e
commit 96573664a6
95 changed files with 4130 additions and 2328 deletions

View file

@ -17,17 +17,18 @@ document.addEventListener("DOMContentLoaded", function () {
const query = searchInput.value.trim().toLowerCase();
resultsList.innerHTML = "";
if (!query) return;
if (!query) {
return;
}
// filter out posts that don't match
const matches = index.filter(
(post) =>
post.title.toLowerCase().includes(query) ||
post.content.toLowerCase().includes(query),
);
if (matches.length === 0) {
resultsList.innerHTML = "<li>No results found.</li>";
resultsList.innerHTML = "<li>You leafed too hard :/</li>";
return;
}