| | |
| | | {{$finalCss := $css | resources.Concat "styles.css" | resources.Fingerprint "md5" | resources.Minify }} |
| | | <link href="{{$finalCss.Permalink}}" rel="stylesheet" /> |
| | | |
| | | {{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" | |
| | | resources.Minify }} |
| | | {{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" | resources.Minify }} |
| | | <script src="{{$darkMode.Permalink}}"></script> |
| | | {{partial "katex.html" .}} |
| | | |
| | |
| | | links, |
| | | content, |
| | | })) |
| | | </script> |
| | | {{if $.Site.Data.config.enableSPA}} |
| | | {{ $router := resources.Get "js/router.js" | resources.Fingerprint "md5" | |
| | | resources.Minify }} |
| | | <script type="module"> |
| | | import { attachSPARouting } from '{{$router.Permalink}}'; |
| | | // NOTE: everything within this callback will be executed for every page navigation. This is a good place to put JavaScript that loads or modifies data on the page. |
| | | |
| | | const draw = () => { |
| | | // NOTE: everything within this callback will be executed for every page navigation. This is a good place to put JavaScript that loads or modifies data on the page. |
| | | {{if $.Site.Data.config.enableFooter}} |
| | | const container = document.getElementById("graph-container") |
| | | // retry if the graph is not ready |
| | | if (!container) return requestAnimationFrame(draw) |
| | |
| | | {{$.Site.Data.graphConfig.enableLegend}}, |
| | | {{$.Site.Data.graphConfig.enableZoom}} |
| | | ); |
| | | |
| | | {{end}} |
| | | {{if $.Site.Data.config.enableLinkPreview}} |
| | | initPopover({{strings.TrimRight "/" .Site.BaseURL }}, {{$.Site.Data.config.enableContextualBacklinks}}) |
| | | initPopover( |
| | | {{strings.TrimRight "/" .Site.BaseURL }}, |
| | | {{$.Site.Data.config.enableContextualBacklinks}}, |
| | | {{$.Site.Data.config.enableLatex}} |
| | | ) |
| | | {{end}} |
| | | {{if $.Site.Data.config.enableLatex}} |
| | | renderMathInElement(document.body, { |
| | |
| | | }); |
| | | {{end}} |
| | | }; |
| | | attachSPARouting(draw); |
| | | </script> |
| | | {{if $.Site.Data.config.enableSPA}} |
| | | {{ $router := resources.Get "js/router.js" | resources.Fingerprint "md5" | |
| | | resources.Minify }} |
| | | <script type="module"> |
| | | import { attachSPARouting } from "{{$router.Permalink}}" |
| | | attachSPARouting(draw) |
| | | </script> |
| | | {{else}} |
| | | <script>window.navigate = (url) => window.location.href = url</script> |
| | | <script> |
| | | window.Million = { |
| | | navigate: (url) => (window.location.href = url), |
| | | prefetch: () => {}, |
| | | } |
| | | draw() |
| | | </script> |
| | | {{end}} |
| | | </head> |
| | | {{ template "_internal/google_analytics.html" . }} |