Commit c1f7f89
feat(search): migrate to Pagefind Component UI (#71)
Replace the hand-rolled <dialog> + Default UI search with Pagefind's
Component UI for both the global ⌘K modal and the /search/ page, plus a
mobile search button in the header.
- Lazy-load the component bundle on first open to keep ~46 kB off
visitors who never search; CSP-safe (external module, no inline JS).
- Preserve full-fidelity Plausible analytics via the component's typed
event API (search/results), reading the exact result count instead of
scraping the rendered DOM.
- Keep our own global ⌘K and "/" shortcuts; the component owns the
modal, focus, ARIA combobox and keyboard navigation.
- Theme the widget to our design tokens in light and dark: map --pf-*
on html[lang] to outrank the component's :root defaults, and force
color-scheme: inherit past its host reset so light-dark() flips.
- Style matched terms with an accent pill and set excerpt length to 30
with multi-line wrapping for more context.
- Point the WebMCP open_search tool at the new modal driver.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b38e3a6 commit c1f7f89
11 files changed
Lines changed: 387 additions & 432 deletions
File tree
- public
- src
- components
- content/changelog
- layouts
- pages
- styles
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
0 commit comments