2023-07-19 22:11:34 +01:00
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8" />
|
2023-08-09 22:57:43 +01:00
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
2023-08-12 19:53:14 +01:00
|
|
|
|
{{ if hugo.IsProduction -}}
|
|
|
|
|
<meta name="robots" content="index, follow" />
|
|
|
|
|
{{ else -}}
|
|
|
|
|
<meta name="robots" content="noindex, nofollow" />
|
|
|
|
|
{{ end -}}
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{ partialCached "favicons.html" . -}}
|
2023-07-19 22:11:34 +01:00
|
|
|
|
<title>
|
2023-08-09 22:57:43 +01:00
|
|
|
|
{{- if .IsHome -}}
|
|
|
|
|
{{ .Site.Title -}}
|
|
|
|
|
{{ else -}}
|
|
|
|
|
{{ with .Title }}{{ . }} – {{ end -}}
|
|
|
|
|
{{ .Site.Title -}}
|
|
|
|
|
{{ end -}}
|
2023-07-19 22:11:34 +01:00
|
|
|
|
</title>
|
2023-08-09 22:57:43 +01:00
|
|
|
|
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />
|
2024-02-20 17:59:31 -05:00
|
|
|
|
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{- with .Params.canonical -}}
|
2024-02-02 00:52:41 +02:00
|
|
|
|
<link rel="canonical" href="{{ . }}" itemprop="url" />
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{- else -}}
|
2024-02-02 00:52:41 +02:00
|
|
|
|
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{- end -}}
|
2023-09-21 08:03:35 +01:00
|
|
|
|
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{- partial "opengraph.html" . -}}
|
|
|
|
|
{{- template "_internal/schema.html" . -}}
|
|
|
|
|
{{- template "_internal/twitter_cards.html" . -}}
|
2023-09-21 08:03:35 +01:00
|
|
|
|
|
2024-11-03 16:53:18 +00:00
|
|
|
|
{{- partialCached "head-css.html" . -}}
|
2023-09-21 08:03:35 +01:00
|
|
|
|
|
|
|
|
|
|
2025-03-30 21:20:50 +01:00
|
|
|
|
<!-- Google Analytics -->
|
|
|
|
|
{{- if and (eq hugo.Environment "production") .Site.Config.Services.GoogleAnalytics.ID }}
|
|
|
|
|
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
|
|
|
|
|
{{ partial "google-analytics.html" . }}
|
|
|
|
|
{{- end }}
|
2023-09-21 08:03:35 +01:00
|
|
|
|
|
2023-07-30 21:50:41 +01:00
|
|
|
|
<script>
|
|
|
|
|
/* Initialize light/dark mode */
|
2023-10-21 17:18:04 -04:00
|
|
|
|
const defaultTheme = '{{ site.Params.theme.default | default `system`}}';
|
|
|
|
|
|
|
|
|
|
const setDarkTheme = () => {
|
2023-07-30 21:50:41 +01:00
|
|
|
|
document.documentElement.classList.add("dark");
|
2023-09-13 19:01:38 -04:00
|
|
|
|
document.documentElement.style.colorScheme = "dark";
|
2023-10-21 17:18:04 -04:00
|
|
|
|
}
|
|
|
|
|
const setLightTheme = () => {
|
2023-07-30 21:50:41 +01:00
|
|
|
|
document.documentElement.classList.remove("dark");
|
2023-09-13 19:01:38 -04:00
|
|
|
|
document.documentElement.style.colorScheme = "light";
|
2023-07-30 21:50:41 +01:00
|
|
|
|
}
|
2023-10-21 17:18:04 -04:00
|
|
|
|
|
|
|
|
|
if ("color-theme" in localStorage) {
|
|
|
|
|
localStorage.getItem("color-theme") === "dark" ? setDarkTheme() : setLightTheme();
|
|
|
|
|
} else {
|
|
|
|
|
defaultTheme === "dark" ? setDarkTheme() : setLightTheme();
|
|
|
|
|
if (defaultTheme === "system") {
|
|
|
|
|
window.matchMedia("(prefers-color-scheme: dark)").matches ? setDarkTheme() : setLightTheme();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-30 21:50:41 +01:00
|
|
|
|
</script>
|
2023-08-09 22:57:43 +01:00
|
|
|
|
|
2025-03-30 19:05:35 +02:00
|
|
|
|
<!-- KaTeX-->
|
2025-03-30 21:20:50 +01:00
|
|
|
|
{{ $noop := .WordCount -}}
|
|
|
|
|
{{ if .Page.Store.Get "hasMath" -}}
|
|
|
|
|
<!-- TODO: make url configurable -->
|
|
|
|
|
{{ $katexCssUrl := printf "https://cdn.jsdelivr.net/npm/katex@latest/dist/katex%s.css" (cond hugo.IsProduction ".min" "") -}}
|
|
|
|
|
{{ with try (resources.GetRemote $katexCssUrl) -}}
|
2025-03-30 19:05:35 +02:00
|
|
|
|
{{ with .Err -}}
|
2025-03-30 21:20:50 +01:00
|
|
|
|
{{ errorf "Could not retrieve KaTeX css file from %s. Reason: %s." $katexCssUrl . -}}
|
2025-03-30 19:05:35 +02:00
|
|
|
|
{{ else with.Value -}}
|
2025-03-30 21:20:50 +01:00
|
|
|
|
{{ with resources.Copy (printf "css/katex%s.css" (cond hugo.IsProduction ".min" "")) . -}}
|
|
|
|
|
<link rel="stylesheet" href="{{- .RelPermalink -}}" integrity="{{- . | fingerprint -}}" crossorigin="anonymous" />
|
2025-03-30 19:05:35 +02:00
|
|
|
|
{{ end -}}
|
|
|
|
|
{{ end -}}
|
|
|
|
|
{{ end -}}
|
2025-03-30 21:20:50 +01:00
|
|
|
|
{{ end -}}
|
2025-03-30 19:05:35 +02:00
|
|
|
|
|
2025-03-30 21:20:50 +01:00
|
|
|
|
{{ partial "custom/head-end.html" . -}}
|
2023-07-19 22:11:34 +01:00
|
|
|
|
</head>
|