Add client-side search with / shortcut
Lazy-loads /index.json on first keystroke, fuzzy-matches titles and descriptions, keyboard-navigable results (arrows, Enter, Esc). Based on https://gist.github.com/cmod/5410eae147e4318164258742dd053993 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="myname">
|
||||
<h2><a href="{{ default .Site.Home .Site.BaseURL }}">{{ default .Site.Params.Author .Site.Params.siteHeading }}</a></h2>
|
||||
</div>
|
||||
<nav>
|
||||
<nav id="mainNav">
|
||||
<ul class="navbar">
|
||||
{{- /* info about current page */ -}}
|
||||
{{- $currentPage := . -}}
|
||||
@@ -67,4 +67,8 @@
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
<div id="fastSearch">
|
||||
<input id="searchInput" tabindex="0" placeholder="Search…" aria-label="Search" autocomplete="off">
|
||||
<ul id="searchResults"></ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user