{{- if not hugo.IsProduction }} {{- end }} {{- with .Description | default ($.Param "description") }} {{- end }} {{ block "favicon" . }}{{ partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/favicon.html") . }}{{ end }} {{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/opengraph") . }} {{- partial (printf "%s/%s" ($.Scratch.Get "pathName") "head/twitter_cards") . }} {{ if eq .Site.Params.docs.darkMode true -}} {{ $darkModeInit := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/darkmode-init.js") | js.Build | minify -}} {{ end -}} {{ if or (not (isset .Site.Params.flexsearch "enabled")) (eq .Site.Params.flexsearch.enabled true) -}} {{ if and (.Site.Params.docsearch.appID) (.Site.Params.docsearch.apiKey) -}} {{ else }} {{ $flexSearch := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/flexsearch.bundle.js") }} {{- if not .Site.IsServer }} {{ $flexSearch := $flexSearch | minify | fingerprint "sha384" }} {{ else }} {{ end }} {{ end }} {{ end }} {{- partialCached "google-fonts" . }} {{- $options := dict "enableSourceMap" true }} {{- if hugo.IsProduction}} {{- $options := dict "enableSourceMap" false "outputStyle" "compressed" }} {{- end }} {{- $style := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/style.scss") }} {{- $style = $style | resources.ExecuteAsTemplate (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/style.scss") . | resources.ToCSS $options }} {{- if hugo.IsProduction }} {{- $style = $style | minify | fingerprint "sha384" }} {{- end -}} {{- if .Params.katex -}} {{- $options := dict "enableSourceMap" true }} {{- if hugo.IsProduction}} {{- $options := dict "enableSourceMap" false "outputStyle" "compressed" }} {{- end -}} {{- $katexCSS := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/katex.scss") }} {{- $katexCSS = $katexCSS | resources.ExecuteAsTemplate (printf "/%s/%s" ($.Scratch.Get "pathName") "scss/katex.scss") . | resources.ToCSS $options }} {{- if hugo.IsProduction }} {{- $katexCSS = $katexCSS | minify | fingerprint "sha384" }} {{- end -}} {{- end -}} {{- if .Params.katex -}} {{ $katex := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/katex.js") }} {{ $katexAutoRender := resources.Get (printf "/%s/%s" ($.Scratch.Get "pathName") "js/auto-render.js") }} {{ if hugo.IsProduction }} {{ $katex = $katex | minify | fingerprint "sha384" }} {{ $katexAutoRender = $katexAutoRender | minify | fingerprint "sha384" }} {{- end -}} {{ end -}} {{ if .Params.katex }} {{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "footer/katex.html") . -}} {{ end }} {{- if not .Site.IsServer }} {{ if and (.Site.Params.plausible.scriptURL | default "https://plausible.io") (.Site.Params.plausible.dataDomain) -}} {{- partialCached (printf "%s/%s" ($.Scratch.Get "pathName") "head/plausible") . }} {{- end -}} {{- end -}} {{- if not .Site.IsServer }} {{- if .Site.GoogleAnalytics }} {{- template "_internal/google_analytics.html" . -}} {{- end -}} {{- end -}}