2023-04-26 11:35:42 +02:00
< head lang = "{{ .Site.Language.Lang }}" >
2020-04-08 20:44:29 +02:00
< meta charset = "utf-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
{{- $title := ( .Title ) -}}
{{- $siteTitle := ( .Site.Title ) -}}
{{- if .IsHome -}}
2020-06-24 09:57:58 +02:00
< title > {{ $siteTitle }} | Home < / title >
2020-04-08 20:44:29 +02:00
{{- else -}}
< title > {{ $title }} - {{ $siteTitle }}< / title >
{{- end -}}
{{- if isset .Site.Params "favicon" -}}
< link rel = "icon" type = "image/png" href = {{ . Site . Params . favicon } } / >
{{- end -}}
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2021-05-22 17:54:55 +02:00
< meta name = "description" content = "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" / >
2020-06-24 09:57:58 +02:00
< meta property = "og:image" content = "{{ .Site.Params.og_image }}" / >
2020-04-08 20:44:29 +02:00
{{ with .OutputFormats.Get "rss" -}}
{{ printf `< link rel = "%s" type = "%s" href = "%s" title = "%s" / > ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
2021-06-08 21:57:36 +02:00
2020-04-08 20:44:29 +02:00
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
2020-10-20 20:03:23 +02:00
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
2022-02-03 06:43:40 +01:00
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
2020-04-10 21:41:05 +02:00
{{ end }}
2024-08-25 11:30:44 +02:00
2020-10-20 20:03:23 +02:00
{{ if .Site.Params.useCDN | default false -}}
< link href = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel = "stylesheet" >
< link href = "https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel = "stylesheet" >
< link href = "https://fonts.googleapis.com/css?family=Roboto+Mono" rel = "stylesheet" >
{{- else -}}
2021-06-04 23:34:27 +02:00
{{ $fontstyle := resources.Get "css/fonts.css" | fingerprint }}
< link href = "{{ $fontstyle.Permalink }}" rel = "stylesheet" >
2020-10-20 20:03:23 +02:00
{{ end }}
2021-06-08 21:57:36 +02:00
2021-06-04 23:34:27 +02:00
{{ $style := resources.Get "css/main.css" | fingerprint }}
< link rel = "stylesheet" type = "text/css" media = "screen" href = "{{ $style.Permalink }}" / >
2021-06-08 21:57:36 +02:00
2021-09-24 19:38:28 +02:00
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") (eq .Site.Params.mode "toggle") -}}
2021-06-04 23:34:27 +02:00
{{ $darkstyle := resources.Get "css/dark.css" | fingerprint }}
2021-09-24 19:38:28 +02:00
< link id = "darkModeStyle" rel = "stylesheet" type = "text/css" href = "{{ $darkstyle.Permalink }}" { { if eq . Site . Params . mode " auto " } } media = "(prefers-color-scheme: dark)" { { end } } { { if eq . Site . Params . mode " toggle " } } disabled { { end } } / >
2020-10-04 18:11:49 +02:00
{{ end }}
2022-12-29 12:52:53 +01:00
<!-- Mathjax support -->
{{ with .Site.Params.mathjax }}
< script type = "text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
< / script >
2024-07-27 08:15:56 +02:00
2022-12-29 12:52:53 +01:00
<!-- inline Mathjax -->
< script type = "text/x-mathjax-config" >
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
displayMath: [['$$','$$'], ['\[','\]']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"] }
}
});
< / script >
{{ end }}
<!-- KaTeX support -->
{{ with .Site.Params.katex }}
< link rel = "stylesheet" href = "https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css" >
< script defer src = "https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js" > < / script >
< script defer src = "https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload = "renderMathInElement(document.body);" > < / script >
2024-07-27 08:15:56 +02:00
2022-12-29 12:52:53 +01:00
<!-- inline KaTeX -->
< script >
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false}
]
});
});
< / script >
{{ end }}
2024-07-27 08:15:56 +02:00
2020-10-04 18:11:49 +02:00
<!-- Custom CSS style get applied last -->
{{- if isset .Site.Params "customcss" }}
{{ range .Site.Params.customCSS }}
2021-06-08 21:57:36 +02:00
{{ $customstyle := resources.Get . | fingerprint }}
< link rel = "stylesheet" type = "text/css" href = "{{ $customstyle.Permalink }}" >
2020-10-04 18:11:49 +02:00
{{ end }}
2020-04-16 09:20:38 +02:00
{{- end -}}
2020-04-08 20:44:29 +02:00
{{- range .Site.Params.customJS }}
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
< script src = "{{ . }}" > < / script >
2022-02-27 10:10:25 +01:00
{{- else if (hasPrefix . "< script " ) } }
{{ .| safeHTML }}
2020-04-08 20:44:29 +02:00
{{- else }}
2024-07-27 08:15:56 +02:00
< script src = "{{ absURL . }}" > < / script >
2020-04-08 20:44:29 +02:00
{{- end }}
{{- end }}
2020-10-04 18:11:49 +02:00
< / head >