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

@@ -28,7 +28,7 @@
{{- /* JS retrieval: get raw JS from either local asset or remote, then process */ -}}
{{- if $isRemoteBase -}}
{{- $jsPath := cond (ne $mermaidJsAsset "") $mermaidJsAsset (printf "mermaid%s.js" $minSuffix) -}}
{{- $mermaidJsUrl := printf "%s/%s" $mermaidBase $jsPath -}}
{{- $mermaidJsUrl := urls.JoinPath $mermaidBase $jsPath -}}
{{- with try (resources.GetRemote $mermaidJsUrl) -}}
{{- with .Err -}}
{{- errorf "Could not retrieve Mermaid js file from %s. Reason: %s." $mermaidJsUrl . -}}