mirror of https://github.com/jpanther/congo.git
151 lines
6.1 KiB
HTML
151 lines
6.1 KiB
HTML
<head>
|
|
<meta charset="utf-8" />
|
|
{{ with .Site.LanguageCode }}
|
|
<meta http-equiv="content-language" content="{{ . }}" />
|
|
{{ end }}
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
{{/* Title */}}
|
|
{{ if .IsHome -}}
|
|
<title>{{ .Site.Title }}</title>
|
|
<meta name="title" content="{{ .Site.Title }}" />
|
|
{{- else -}}
|
|
<title>{{ .Title }} · {{ .Site.Title }}</title>
|
|
<meta name="title" content="{{ .Title }} · {{ .Site.Title }}" />
|
|
{{- end }}
|
|
{{/* Metadata */}}
|
|
{{ with .Params.Description -}}
|
|
<meta name="description" content="{{ . }}" />
|
|
{{- else -}}
|
|
<meta name="description" content="{{ $.Site.Params.Description }}" />
|
|
{{- end }}
|
|
{{ with .Site.Params.keywords -}}
|
|
<meta name="keywords" content="{{ . }}" />
|
|
{{- end }}
|
|
{{ with .Site.Params.robots }}
|
|
<meta name="robots" content="{{ . }}" />
|
|
{{ end }}
|
|
{{ with .Params.robots }}
|
|
<meta name="robots" content="{{ . }}" />
|
|
{{ end }}
|
|
<link rel="canonical" href="{{ .Permalink }}" />
|
|
{{ range .AlternativeOutputFormats -}}
|
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
|
{{ end -}}
|
|
{{/* Styles */}}
|
|
{{ $schemeCSS := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "congo")) }}
|
|
{{ if not $schemeCSS }}
|
|
{{ $schemeCSS = resources.Get "css/schemes/congo.css" }}
|
|
{{ end }}
|
|
{{ $schemeStyles := $schemeCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
|
<link
|
|
type="text/css"
|
|
rel="stylesheet"
|
|
href="{{ $schemeStyles.RelPermalink }}"
|
|
integrity="{{ $schemeStyles.Data.Integrity }}"
|
|
/>
|
|
{{ $mainCSS := resources.Get "css/compiled/main.css" }}
|
|
{{ $mainStyles := $mainCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
|
<link
|
|
type="text/css"
|
|
rel="stylesheet"
|
|
href="{{ $mainStyles.RelPermalink }}"
|
|
integrity="{{ $mainStyles.Data.Integrity }}"
|
|
/>
|
|
{{ $customCSS := resources.Get "css/custom.css" }}
|
|
{{ if $customCSS }}
|
|
{{ $customStyles := $customCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
|
<link
|
|
type="text/css"
|
|
rel="stylesheet"
|
|
href="{{ $customStyles.RelPermalink }}"
|
|
integrity="{{ $customStyles.Data.Integrity }}"
|
|
/>
|
|
{{ end }}
|
|
{{ if eq (.Site.Params.darkMode | default "auto") "auto" }}
|
|
<script>
|
|
function loadPreferredAppearance() {
|
|
if (localStorage.preferredAppearance === "dark" || (!("preferredAppearance" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
|
document.documentElement.classList.add("dark");
|
|
} else {
|
|
document.documentElement.classList.remove("dark");
|
|
}
|
|
}
|
|
function setPreferredAppearance(scheme) {
|
|
if (scheme == "default") {
|
|
localStorage.removeItem("preferredAppearance");
|
|
} else {
|
|
localStorage.preferredAppearance = scheme;
|
|
}
|
|
loadPreferredAppearance();
|
|
}
|
|
loadPreferredAppearance();
|
|
window.matchMedia("(prefers-color-scheme: dark)").addListener(loadPreferredAppearance);
|
|
</script>
|
|
{{ else }}
|
|
<script>
|
|
localStorage.removeItem("preferredAppearance");
|
|
</script>
|
|
{{ end }}
|
|
{{/* Icons */}}
|
|
{{ if templates.Exists "partials/favicons.html" }}
|
|
{{ partialCached "favicons.html" .Site }}
|
|
{{ else }}
|
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}" />
|
|
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}" />
|
|
{{ end }}
|
|
{{/* Site Verification */}}
|
|
{{ with .Site.Params.verification.google }}
|
|
<meta name="google-site-verification" content="{{ . }}" />
|
|
{{ end }}
|
|
{{ with .Site.Params.verification.bing }}
|
|
<meta name="msvalidate.01" content="{{ . }}" />
|
|
{{ end }}
|
|
{{ with .Site.Params.verification.pinterest }}
|
|
<meta name="p:domain_verify" content="{{ . }}" />
|
|
{{ end }}
|
|
{{ with .Site.Params.verification.yandex }}
|
|
<meta name="yandex-verification" content="{{ . }}" />
|
|
{{ end }}
|
|
{{/* Social */}}
|
|
{{ template "_internal/opengraph.html" . }}
|
|
{{ template "_internal/twitter_cards.html" . }}
|
|
{{/* Schema */}}
|
|
{{ partial "schema.html" . }}
|
|
{{/* Generator */}}
|
|
{{ if .Site.Params.attribution | default true }}
|
|
{{ hugo.Generator }}
|
|
{{ end }}
|
|
{{/* Me */}}
|
|
{{ with .Site.Author.name }}<meta name="author" content="{{ . }}" />{{ end }}
|
|
{{ with .Site.Author.links }}
|
|
{{ range $links := . }}
|
|
{{ range $name, $url := $links }}<link href="{{ $url }}" rel="me" />{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{/* Mermaid */}}
|
|
{{ if .Page.HasShortcode "mermaid" }}
|
|
{{ $mermaidJS := resources.Get "vendor/mermaid/mermaid.min.js" }}
|
|
{{ if $mermaidJS }}
|
|
{{ $mermaidJS := $mermaidJS | resources.Fingerprint "sha512" }}
|
|
<script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
function css(name) {
|
|
return getComputedStyle(document.documentElement).getPropertyValue(name);
|
|
}
|
|
mermaid.initialize({ theme: "base", themeVariables: { background: css("--color-neutral"), primaryColor: css("--color-primary-200"), secondaryColor: css("--color-secondary-200"), tertiaryColor: css("--color-neutral-100"), primaryBorderColor: css("--color-primary-400"), secondaryBorderColor: css("--color-secondary-400"), tertiaryBorderColor: css("--color-neutral-400"), lineColor: css("--color-neutral-600"), fontFamily: "ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif", fontSize: "16px" }});
|
|
});
|
|
</script>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{/* Analytics */}}
|
|
{{ partialCached "analytics.html" .Site }}
|
|
{{/* Extend head - eg. for custom analytics scripts, etc. */}}
|
|
{{ if templates.Exists "partials/extend-head.html" }}
|
|
{{ partialCached "extend-head.html" .Site }}
|
|
{{ end }}
|
|
</head>
|