mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-31 04:58:14 +00:00
Gabriel Arazas
37b96902e8
That experiment for short long-term evaluation whether or not external link style is worth it or not is over. And I think it's too much considering that the target audience is for personal blogs which will not mind such things. Plus the amount of things to make it work properly is just too much (i.e., the font has to have the glyph).
63 lines
2.2 KiB
HTML
63 lines
2.2 KiB
HTML
<title>{{ if not .IsHome }}{{ .Title | safeHTML }} |{{ end }} {{ $.Site.Title | safeHTML }}</title>
|
|
|
|
{{- $stylesheets := slice }}
|
|
|
|
<!-- The main stylesheet being compiled. -->
|
|
{{- $main := resources.Get "scss/main.scss" | resources.ToCSS }}
|
|
|
|
{{- /* Combine all of the custom schems in under one stylesheet */ -}}
|
|
{{- $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. */ -}}
|
|
{{ $stylesheets = $stylesheets | append $themes $main }}
|
|
|
|
{{ $style := $stylesheets | resources.Concat "css/main.css" }}
|
|
|
|
{{- /* Only enable asset bundling in production */ -}}
|
|
{{- if hugo.IsProduction }}
|
|
{{- $style = $style | resources.Minify | resources.Fingerprint -}}
|
|
{{- end }}
|
|
<link rel="stylesheet" href="{{ $style.Permalink }}" />
|
|
|
|
<link rel="shortcut icon" href="{{ absURL "favicon.png" }}" />
|
|
|
|
{{- /* 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" . }}
|
|
{{- template "_internal/schema.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 }}
|
|
|
|
|
|
{{- /* Persistent theme.
|
|
It's a very small script so there's little effect on perceived performance. */ -}}
|
|
<script>
|
|
let theme = window.localStorage.getItem('theme');
|
|
if (theme) {
|
|
document.documentElement.dataset.theme = theme;
|
|
}
|
|
</script>
|
|
|