diff options
| author | Arne Rief <riearn@proton.me> | 2026-01-09 12:24:05 +0100 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2026-01-09 12:24:05 +0100 |
| commit | f8541ef965ca22e746b523eb418e47cb4f78f2d8 (patch) | |
| tree | 49e1540ed42595a44196817eadf97337587a2aea /layouts/baseof.html | |
| parent | 038054b8206a9c25e84adeb0f0f355abd22d6143 (diff) | |
Upgrade to new template system from Hugo v0.146.0
Diffstat (limited to 'layouts/baseof.html')
| -rw-r--r-- | layouts/baseof.html | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/layouts/baseof.html b/layouts/baseof.html new file mode 100644 index 0000000..99f09d9 --- /dev/null +++ b/layouts/baseof.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html lang="{{ .Language.LanguageCode }}" dir="{{ .Language.LanguageDirection | default "ltr" }}"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>{{ block "title" . }}{{ if and (not .IsHome) .Title }}{{ .Title }} | {{ end }}{{ site.Title }}{{ end }}</title> + + {{- with .Description }} + <meta name="description" content="{{ . }}"> + {{- else }} + {{- if or .IsPage .IsSection}} + <meta name="description" content="{{ .Summary | plainify | default (printf "%s | %s" .Title site.Title) }}"> + {{- else }} + <meta name="description" content="{{ site.Params.description | default site.Title }}"> + {{- end }} + {{- end }} + + <meta name="generator" content="Hugo {{ hugo.Version }}"> + <link rel="canonical" href="{{ .Permalink }}"> + + {{- if .IsTranslated }} + {{- range .Translations }} + <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"> + {{- end }} + {{- end }} + + {{- with .OutputFormats.Get "rss" }} + {{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} + {{- end }} + + {{- partial "head/meta.html" . }} + {{- partial "head/seo.html" . }} + <!-- Prevent FOUC, default light mode --> + <script> + const storedTheme = localStorage.getItem("theme"); + const prefDarkmode = window.matchMedia("(prefers-color-scheme: dark)").matches; + document.documentElement.setAttribute("data-theme", storedTheme ?? (prefDarkmode ? "dark" : "light")); + </script> + {{- partialCached "head/css.html" . }} + {{ partialCached "head/js.html" . }} + </head> + + <body class="{{ .Type | default "page" }}"> + {{ partial "header.html" . }} + {{ partial "navmenu.html" (dict "menuID" "main" "page" .) }} + + <main id="main-content" class="site__main" role="main"> + {{ block "main" . }}{{ end }} + </main> + + {{ partial "footer.html" . }} + </body> +</html> |
