Add client-side search functionality for the protected Architecture section, allowing users to quickly find ADRs and other architecture documentation.
Why Lunr.js?
Build Time: Runtime:
┌─────────────┐ ┌─────────────┐
│ Jekyll │──generates──────────│ search.json │
│ builds site │ │ (index) │
└─────────────┘ └──────┬──────┘
│
▼
┌─────────────┐
│ Lunr.js │
│ searches │
│ client-side │
└─────────────┘
docs/search.json)Jekyll generates JSON index at build time:
[
{
"title": "ADR-001: Vite als Build-Tool",
"url": "/architecture/adrs/ADR-001/",
"content": "Full text content...",
"category": "adr",
"status": "accepted"
}
]
Add search box to Architecture index page (/architecture/):
<div class="arch-search">
<input type="text" id="arch-search-input"
placeholder="ADRs durchsuchen...">
<div id="arch-search-results"></div>
</div>
docs/assets/js/arch-search.js)Search covers Architecture section only:
_adrs collection)| File | Action |
|---|---|
docs/search.json |
Create - Liquid template for index |
docs/assets/js/arch-search.js |
Create - Search logic |
docs/_pages/architecture/index.md |
Modify - Add search box |
docs/assets/css/aquarius.css |
Modify - Search styling |
docs/_layouts/protected.html |
Modify - Include Lunr.js |
/architecture/ page, or also on ADR index?Simple.Jekyll.Search: Even lighter, but less powerful (no fuzzy matching, no relevance scoring). Lunr.js is still simple but more capable.