mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 08:44:56 +02:00
- Replace broken client-side type filter on /blog/ with navigation pill links to dedicated collection pages (with post counts) - Replace Load More with proper prev/next/page-number pagination on Interactions inbound tab (20 per page, filter resets page) - Add auto-unfurl transform for standalone external links in notes - Exclude Digest and Categories pages from Pagefind search index - Add Pagefind search filters for post type, year, and category - Add Pagefind filter metadata to page.njk layout Confab-Link: http://localhost:8080/sessions/956f4251-b4a9-4bc9-b214-53402ad1fe63
40 lines
1.6 KiB
Plaintext
40 lines
1.6 KiB
Plaintext
---
|
|
layout: layouts/base.njk
|
|
title: Search
|
|
permalink: /search/
|
|
eleventyExcludeFromCollections: true
|
|
pagefindIgnore: true
|
|
---
|
|
<div class="page-header mb-6 sm:mb-8">
|
|
<h1 class="text-2xl sm:text-3xl font-bold text-surface-900 dark:text-surface-100 mb-2">Search</h1>
|
|
<p class="text-surface-600 dark:text-surface-400">Search across all posts, articles, notes, and pages.</p>
|
|
</div>
|
|
|
|
<div id="search"></div>
|
|
<noscript>
|
|
<div class="p-6 bg-surface-100 dark:bg-surface-800 rounded-lg mt-4">
|
|
<p class="text-surface-700 dark:text-surface-300">Search requires JavaScript to be enabled. Please enable JavaScript in your browser settings to use the search feature.</p>
|
|
<p class="text-surface-500 text-sm mt-2">Alternatively, you can browse content via the <a href="/blog/" class="text-accent-600 dark:text-accent-400 hover:underline">blog archive</a> or <a href="/categories/" class="text-accent-600 dark:text-accent-400 hover:underline">categories</a>.</p>
|
|
</div>
|
|
</noscript>
|
|
|
|
<script>
|
|
initPagefind("#search", { showSubResults: true, showEmptyFilters: false });
|
|
|
|
// Support ?q= query parameter and auto-focus
|
|
window.addEventListener("DOMContentLoaded", () => {
|
|
const params = new URLSearchParams(window.location.search);
|
|
const query = params.get("q");
|
|
if (query) {
|
|
const input = document.querySelector("#search input[type='text']");
|
|
if (input) {
|
|
input.value = query;
|
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
}
|
|
} else {
|
|
const input = document.querySelector("#search input[type='text']");
|
|
if (input) input.focus();
|
|
}
|
|
});
|
|
</script>
|