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:
@@ -0,0 +1,11 @@
|
||||
{{- $index := slice -}}
|
||||
{{- range .Site.RegularPages -}}
|
||||
{{- $index = $index | append (dict
|
||||
"title" .Title
|
||||
"desc" (.Summary | plainify)
|
||||
"contents" .Plain
|
||||
"section" .Section
|
||||
"date" (.Date.Format "2006-01-02")
|
||||
"permalink" .Permalink) -}}
|
||||
{{- end -}}
|
||||
{{- $index | jsonify -}}
|
||||
Reference in New Issue
Block a user