Update head partial template

This commit is contained in:
Gabriel Arazas 2024-05-18 18:51:19 +08:00
parent 183ff17c9f
commit 8e70913ee4
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -6,9 +6,11 @@
{{- $main := resources.Get "scss/main.scss" | resources.ToCSS }} {{- $main := resources.Get "scss/main.scss" | resources.ToCSS }}
{{- /* Combine all of the custom schems in under one stylesheet */ -}} {{- /* Combine all of the custom schems in under one stylesheet */ -}}
{{- $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS }} {{- $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS
}}
{{- /* Append the main stylesheet to be the last so the resulting stylesheet will make the custom colorschemes at the front. */ -}} {{- /* Append the main stylesheet to be the last so the resulting stylesheet will make the custom colorschemes at the
front. */ -}}
{{ $stylesheets = $stylesheets | append $themes $main }} {{ $stylesheets = $stylesheets | append $themes $main }}
{{ $style := $stylesheets | resources.Concat "css/main.css" }} {{ $style := $stylesheets | resources.Concat "css/main.css" }}
@ -29,7 +31,6 @@ It's a very small script so there's little effect on perceived performance. */ -
<link rel="shortcut icon" href="{{ relURL " favicon.png" }}" /> <link rel="shortcut icon" href="{{ relURL " favicon.png" }}" />
{{- /* Some sane <meta> tags default */ -}}
{{ hugo.Generator }} {{ hugo.Generator }}
<meta charset="utf-8"> <meta charset="utf-8">
@ -41,20 +42,17 @@ It's a very small script so there's little effect on perceived performance. */ -
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="no-referrer" /> <meta name="referrer" content="no-referrer" />
<meta name="description" content="{{ if (and (eq .Kind "home") .IsHome) }}{{ .Site.Title }}{{ else }}{{ .Summary | safeHTML }}{{ end }}" /> <meta name="description" content="{{ if (and (eq .Kind " home") .IsHome) }}{{ .Site.Title }}{{ else }}{{ .Summary |
safeHTML }}{{ end }}" />
{{- template "_internal/twitter_cards.html" . }} {{- template "_internal/twitter_cards.html" . }}
{{- template "_internal/opengraph.html" . }} {{- template "_internal/opengraph.html" . }}
{{- template "_internal/schema.html" . }} {{- template "_internal/schema.html" . }}
{{- /* Linking all of the output formats for discovery. */ -}}
{{- range .OutputFormats }} {{- range .OutputFormats }}
{{- printf "<link rel=%q type=%q href=%q />" .Rel .MediaType.Type .RelPermalink | safeHTML }} {{- printf "<link rel=%q type=%q href=%q />" .Rel .MediaType.Type .RelPermalink | safeHTML }}
{{- end }} {{- end }}
{{- if hugo.IsProduction }} {{- if hugo.IsProduction }}
{{ template "_internal/google_analytics_async.html" . }}
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
{{- end }} {{- end }}