Expand description
Client-side search index generator and search UI. Client-side search index generator.
Generates a JSON search index and injects a search UI into HTML pages, providing instant full-text search without any server or external service.
§How it works
- At build time,
SearchIndexscans all HTML files in the site directory. - It extracts the page title, URL, headings, and body text.
- It writes a
search-index.jsonfile to the site root. - The
SearchPlugininjects a<script>tag and search UI into every HTML page that loads the index and performs client-side fuzzy matching.
The search UI is a modal overlay activated by Ctrl+K / Cmd+K.
Structs§
- Localized
Search Plugin - Variant of
SearchPluginthat injects the widget with caller-supplied localizedSearchLabels. - Search
Entry - A single entry in the search index.
- Search
Index - The complete search index written to
search-index.json. - Search
Labels - Localizable strings shown in the search widget UI.
- Search
Plugin - Plugin that generates a search index and injects client-side search UI.
Constants§
- MAX_
CONTENT_ LENGTH - Maximum content length per page in the search index (characters). Keeps the index compact for fast client-side loading.
- MAX_
INDEX_ ENTRIES - Maximum number of pages to index.