{{- /* Mermaid, for pages with a mermaid code block: Hextra's partial of the same name, with the version
pinned in hugo.yaml (params.mermaid.base) and one theme, the site's palette, in place of Hextra's light
and dark ones. Every diagram gets it, so no diagram sets its own. */ -}}
{{- $url := urls.JoinPath site.Params.mermaid.base "mermaid.min.js" -}}
{{- with try (resources.GetRemote $url) -}}
{{- with .Err -}}
{{- errorf "Could not retrieve Mermaid from %s: %s" $url . -}}
{{- else with .Value -}}
{{- with resources.Copy "js/mermaid.min.js" . | fingerprint -}}
{{- end -}}
{{- end -}}
{{- end -}}