summaryrefslogtreecommitdiff
path: root/layouts/_default/baseof.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r--layouts/_default/baseof.html14
1 files changed, 13 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 3c4865b..99f09d9 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>{{ block "title" . }}{{ if .Title }}{{ .Title }} | {{ end }}{{ site.Title }}{{ end }}</title>
+ <title>{{ block "title" . }}{{ if and (not .IsHome) .Title }}{{ .Title }} | {{ end }}{{ site.Title }}{{ end }}</title>
{{- with .Description }}
<meta name="description" content="{{ . }}">
@@ -24,13 +24,25 @@
{{- 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 }}