refactor(search): support local/mirrored FlexSearch assets (#956)

* feat(search): support local and mirrored FlexSearch assets

Add params.search.flexsearch.base/js overrides in search script loading.

Document offline/local and mirror-based script asset configuration examples.

* refactor(scripts): normalize remote asset URL joins

* docs(config): clarify local asset examples

* docs(i18n): add local asset config guidance
This commit is contained in:
Xin
2026-03-06 22:41:40 +00:00
committed by GitHub
parent 792c750dec
commit e12d3b98cc
9 changed files with 368 additions and 19 deletions

View File

@@ -33,7 +33,7 @@
{{- /* CSS retrieval: get raw CSS from either local asset or remote, then process */ -}}
{{- if $isRemoteBase -}}
{{- $cssPath := cond (ne $asciinemaCssAsset "") $asciinemaCssAsset "asciinema-player.css" -}}
{{- $asciinemaCssUrl := printf "%s/%s" $asciinemaBase $cssPath -}}
{{- $asciinemaCssUrl := urls.JoinPath $asciinemaBase $cssPath -}}
{{- with try (resources.GetRemote $asciinemaCssUrl) -}}
{{- with .Err -}}
{{- errorf "Could not retrieve Asciinema css file from %s. Reason: %s." $asciinemaCssUrl . -}}
@@ -56,7 +56,7 @@
{{- /* JS retrieval: get raw JS from either local asset or remote, then process */ -}}
{{- if $isRemoteBase -}}
{{- $jsPath := cond (ne $asciinemaJsAsset "") $asciinemaJsAsset (printf "asciinema-player%s.js" $minSuffix) -}}
{{- $asciinemaJsUrl := printf "%s/%s" $asciinemaBase $jsPath -}}
{{- $asciinemaJsUrl := urls.JoinPath $asciinemaBase $jsPath -}}
{{- with try (resources.GetRemote $asciinemaJsUrl) -}}
{{- with .Err -}}
{{- errorf "Could not retrieve Asciinema js file from %s. Reason: %s." $asciinemaJsUrl . -}}