{{/* Handle legacy Kubernetes shortcode for Mermaid diagrams */}} {{- if (.HasShortcode "mermaid") -}} {{ .Page.Store.Set "hasmermaid" true -}} {{- end -}} {{- if .Page.Store.Get "hasmermaid" -}} {{- partial "scripts/mermaid.html" . -}} {{- end -}} {{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem -}} {{ if $needKaTeX -}} {{/* load stylesheet and scripts for KaTeX support */ -}} {{/* The loading of KaTeX is deferred to speed up page rendering */ -}} {{/* To automatically render math in text elements, include the auto-render extension: */ -}} {{ end -}} {{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.bundle.js" -}} {{ $jsBase := resources.Get "js/base.js" }} {{ $jsNav := resources.Get "js/nav.js" | resources.ExecuteAsTemplate "js/nav.js" .Site.Params }} {{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }} {{ if .Site.Params.offlineSearch }} {{ $jsSearch = resources.Get "js/offline-search.js" }} {{ else if .Site.Params.customSearch }} {{ $jsSearch = resources.Get "js/custom-search.js" }} {{ end }} {{ $jsArray := slice $jsBs $jsBase $jsNav $jsSearch -}} {{ if .Site.Params.ui.showLightDarkModeMenu -}} {{ $jsArray = $jsArray | append (resources.Get "js/dark-mode.js") -}} {{ end -}} {{ $js := $jsArray | resources.Concat "js/main.js" -}} {{ if hugo.IsProduction -}} {{ $js := $js | minify | fingerprint -}} {{ else -}} {{ end -}} {{ if .Site.Params.prism_syntax_highlighting -}} {{ else if false -}} {{ $c2cJS := resources.Get "js/click-to-copy.js" -}} {{ if hugo.IsProduction -}} {{ $c2cJS = $c2cJS | minify | fingerprint -}} {{ end -}} {{ end -}} {{ if .Site.Params.ui.showLightDarkModeMenu -}} {{ $themeSwap := resources.Get "js/theme-image-swap.js" -}} {{ if hugo.IsProduction -}} {{ $themeSwap = $themeSwap | minify | fingerprint -}} {{ else -}} {{ end -}} {{ end -}} {{ partial "hooks/body-end.html" . }}