Hwaro::Content::SearchUi
The built-in search client ([search] ui = true): a dependency-free
script + stylesheet published under assets/hwaro-search/, and the
{{ search_tags }} markup that loads them. The script reads its
settings from a data- attribute, so pages need no inline script.
Constants
i18n keys (i18n/<lang>.toml) and their English defaults. The count
line takes {count}; a [search.results_count] table with one
and other picks the form the way the pluralize filter does.
Instance methods
The client's settings, as JSON (HTML-escaped into the attribute by
tags). lang is set on multilingual sites only: the client then
keeps that language's shards and records.
Every file the UI publishes (claimed by the builder): none unless on.
The page language's own strings first, then the default language's,
then English. A count form (results_count.one) beats the plain
results_count only within the same language.
search_tags per language code (every configured language, the
default first). Empty when the UI is off. cache_bust false drops
the ?v=; sri_root (the output dir, nil when SRI is off) adds
integrity from the emitted files.
Writes the two assets, leaving a byte-identical file untouched so its
mtime (and the SRI memo keyed on it) survives warm builds. They win
over a same-path file under static_dir, which is worth a warning.