hugo-theme-contentful/layouts/partials/head.html
Gabriel Arazas 7ee058f88c Remove theme button in favor of system themes
The support for preferred color schemes is widespread nowadays. It is
also to make this theme more different to More Contentful theme.
2022-05-13 18:12:11 +08:00

47 lines
1.6 KiB
HTML

<title>{{ if .IsHome }}{{ $.Site.Title | safeHTML }}{{ else }}{{ .Title | safeHTML }}{{ end }}</title>
{{- /* Only enable asset bundling in production */ -}}
{{- $style := resources.Get "css/main.css" -}}
{{- /* The custom stylesheet. */ -}}
{{- $custom_styles := resources.Get "css/extend.css" -}}
{{- /*
The order is important since CSS needs orders.
Which means the custom stylesheet should be the last to be concatenated.
*/ -}}
{{- $style = slice $style $custom_styles | resources.Concat "css/index.css" -}}
{{- if hugo.IsProduction }}
{{- $style = $style | resources.Minify | resources.Fingerprint -}}
{{- end }}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
{{- /* Some sane <meta> tags default */ -}}
{{ hugo.Generator }}
<meta charset="utf-8">
{{- with .Site.Author }}
{{- $names := slice }}
{{- range . }}{{ $names = $names | append .name }}{{ end }}
<meta name="author" content="{{ delimit $names ", " (printf " %s " (i18n "and")) }}" />
{{- end }}
<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 }}" />
{{- template "_internal/twitter_cards.html" . }}
{{- template "_internal/opengraph.html" . }}
{{- /* Linking all of the output formats for discovery. */ -}}
{{- range .OutputFormats }}
{{- printf "<link rel=%q type=%q href=%q />" .Rel .MediaType.Type .Permalink | safeHTML }}
{{- end }}
{{- if hugo.IsProduction }}
{{ template "_internal/google_analytics_async.html" . }}
{{ template "_internal/disqus.html" . }}
{{- end }}