{{/* Handle legacy Kubernetes shortcode for Mermaid diagrams */}} {{- if (.HasShortcode "mermaid") -}} {{ .Page.Store.Set "hasmermaid" true -}} {{- end -}} {{/* future Docsy versions move this to partials/mermaid.html */}} {{- if .Page.Store.Get "hasmermaid" -}} {{- 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" }} {{ $jsAnchor := resources.Get "js/anchor.js" }} {{ $jsNav := resources.Get "js/nav.js" | resources.ExecuteAsTemplate "js/nav.js" .Site.Params }} {{ $jsSidebarTree := resources.Get "js/sidebar-tree.js" | resources.ExecuteAsTemplate "js/sidebar-tree.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" }} {{/* Revisit this if / when either of https://github.com/google/docsy/issues/2194 and https://github.com/google/docsy/pull/1512 are closed */}} {{ else if .Site.Params.customSearch }} {{ $jsSearch = resources.Get "js/custom-search.js" }} {{ end }} {{ $js := (slice $jsBs $jsBase $jsAnchor $jsNav $jsSidebarTree $jsSearch) | 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 -}} {{ partial "hooks/body-end.html" . }}