hugo-theme-contentful/layouts/partials/head.html

27 lines
1.0 KiB
HTML
Raw Normal View History

2020-05-11 15:59:06 +00:00
<title>{{ if .IsHome }}{{ $.Site.Title | safeHTML }}{{ else }}{{ .Title | safeHTML }}{{ end }}</title>
<link rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
{{- /* Some sane <meta> tags default */ -}}
{{ hugo.Generator }}
2019-09-20 16:11:12 +00:00
<meta charset="utf-8">
2020-05-11 15:59:06 +00:00
<meta name="author" content="{{ .Param "author.name" }}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="no-referrer" />
<meta name="description" content="{{ if (and (eq .Kind "home") .IsHome) }}{{ .Site.Title }}{{ else }}{{ .Summary | safeHTML }}{{ end }}" />
{{- /* Linking all of the output formats for discovery. */ -}}
{{ range .OutputFormats }}
{{ printf "<link rel=%q type=%q href=%q />" .Rel .MediaType.Type .Permalink | safeHTML }}
{{ end }}
{{- /* Persistent theme.
It's a very small script so there's little effect on perceived performance. */ -}}
2020-05-09 07:19:04 +00:00
<script>
const theme = window.localStorage.getItem('theme');
if (theme) {
document.documentElement.dataset.theme = theme;
}
</script>