feat: allow disable toc on page frontmatter

refactor: move pager to partial/components

chore: add head-css and favicons

- support favicons and page descriptions
- dynamic title based on page
- add custom head-end hook

feat: add opengraph to head

fix: sidebar not hiding when resizing
This commit is contained in:
Xin
2023-08-09 22:57:43 +01:00
parent ad3c607623
commit 750e566d24
11 changed files with 96 additions and 40 deletions

View File

@ -1,18 +1,18 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ partialCached "favicons.html" . }}
<title>
{{ .Title }}
{{- if .IsHome -}}
{{ .Site.Title -}}
{{ else -}}
{{ with .Title }}{{ . }} {{ end -}}
{{ .Site.Title -}}
{{ end -}}
</title>
<meta name="description" content="{{ .Description }}" />
{{ $options := dict "inlineImports" true }}
{{ $styles := resources.Get "css/styles.css" }}
{{ $styles = $styles | resources.PostCSS $options }}
{{ if hugo.IsProduction }}
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
{{ end }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />
{{ partial "opengraph.html" . }}
{{ partial "head-css.html" . }}
<script>
/* Initialize light/dark mode */
if (localStorage.getItem("color-theme") === "dark" || (!("color-theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
@ -21,4 +21,6 @@
document.documentElement.classList.remove("dark");
}
</script>
{{ partial "custom/head-end.html" . }}
</head>