|
@@ -1,3 +1,4 @@
|
|
|
+{{ $scr := .Scratch }}
|
|
|
<head>
|
|
|
<meta charset="utf-8" />
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -8,6 +9,30 @@
|
|
|
<meta name="generator" content="Wowchemy {{ site.Data.wowchemy.version }} for Hugo" />
|
|
|
{{ end }}
|
|
|
|
|
|
+ {{ if .Params.private }}
|
|
|
+ <meta name="robots" content="noindex" />
|
|
|
+ {{- end -}}
|
|
|
+
|
|
|
+ {{/* Parse theme and font */}}
|
|
|
+ {{ partial "functions/parse_theme" . }}
|
|
|
+
|
|
|
+ {{/* Pre-connect to Google Fonts if the site's Font Theme uses them. */}}
|
|
|
+ {{ with ($scr.Get "google_fonts") }}
|
|
|
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
|
+ {{ end }}
|
|
|
+
|
|
|
+ {{/* Load Google Fonts if the site's Font Theme uses them. */}}
|
|
|
+ {{/* Note: we cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
|
|
|
+ {{ with ($scr.Get "google_fonts") }}
|
|
|
+ {{ if hasPrefix . "family=" }}
|
|
|
+ {{/* If `google_fonts` starts with "family=", use API v2 (https://developers.google.com/fonts/docs/css2) */}}
|
|
|
+ <link rel="preload" as="style" {{ printf "href=\"https://fonts.googleapis.com/css2?%s&display=swap\"" . | safeHTMLAttr }}>
|
|
|
+ <link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css2?%s&display=swap\"" . | safeHTMLAttr }} media="print" onload="this.media='all'">
|
|
|
+ {{ else }}
|
|
|
+ {{ errorf "There is a new version of Google Fonts. Learn how to upgrade your font pack at https://wowchemy.com/docs/customization/#custom-font" }}
|
|
|
+ {{ end }}
|
|
|
+ {{ end }}
|
|
|
+
|
|
|
{{ if site.Params.marketing.google_optimize | and hugo.IsProduction }}
|
|
|
<script src="https://www.googleoptimize.com/optimize.js?id={{ site.Params.marketing.google_optimize }}"></script>
|
|
|
{{- end -}}
|
|
@@ -22,8 +47,6 @@
|
|
|
<meta name="msvalidate.01" content="{{ . }}" />
|
|
|
{{- end -}}
|
|
|
|
|
|
- {{ $scr := .Scratch }}
|
|
|
-
|
|
|
{{/* Attempt to load superuser. */}}
|
|
|
{{ $superuser_name := "" }}
|
|
|
{{ $superuser_username := "" }}
|
|
@@ -57,13 +80,6 @@
|
|
|
{{ end }}
|
|
|
<link rel="alternate" hreflang="{{ site.LanguageCode | default "en-us" }}" href="{{ .Permalink }}" />
|
|
|
|
|
|
- {{ partial "functions/parse_theme" . }}
|
|
|
-
|
|
|
- {{/* Pre-connect to Google Fonts if the site's Font Theme uses them. */}}
|
|
|
- {{ with ($scr.Get "google_fonts") }}
|
|
|
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
|
- {{ end }}
|
|
|
-
|
|
|
{{ $css := site.Data.assets.css }}
|
|
|
{{ $js := site.Data.assets.js }}
|
|
|
{{ if ne ($scr.Get "primary") "#fff" }}
|
|
@@ -175,24 +191,9 @@
|
|
|
{{ end }}
|
|
|
{{ end }}
|
|
|
|
|
|
- {{/* Load Google Fonts if the site's Font Theme uses them. */}}
|
|
|
- {{/* Note: we cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
|
|
|
- {{ with ($scr.Get "google_fonts") }}
|
|
|
- {{ if hasPrefix . "family=" }}
|
|
|
- {{/* If `google_fonts` starts with "family=", use API v2 (https://developers.google.com/fonts/docs/css2) */}}
|
|
|
- <link rel="preload" as="style" {{ printf "href=\"https://fonts.googleapis.com/css2?%s&display=swap\"" . | safeHTMLAttr }}>
|
|
|
- <link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css2?%s&display=swap\"" . | safeHTMLAttr }} media="print" onload="this.media='all'">
|
|
|
- {{ else }}
|
|
|
- {{/* Otherwise, use API v1 */}}
|
|
|
- {{/* Hugo's htmlEscape cannot escape "|" in Google Font URIs so we implement our own escape functionality. */}}
|
|
|
- <link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" . | replaceRE "\\|" "%7C" | safeHTMLAttr }}>
|
|
|
- {{ warnf "There is a new version of Google Fonts. Learn how to upgrade your font pack at https://wowchemy.com/docs/customization/#custom-font" }}
|
|
|
- {{ end }}
|
|
|
- {{ end }}
|
|
|
-
|
|
|
{{ $license := printf "/*! Wowchemy v%s | https://wowchemy.com/ */\n" site.Data.wowchemy.version }}
|
|
|
{{ $license := $license | printf "%s/*! Copyright 2016-present George Cushen (https://georgecushen.com/) */\n" }}
|
|
|
- {{ $license := $license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-modules/blob/main/LICENSE.md */\n" }}
|
|
|
+ {{ $license := $license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */\n" }}
|
|
|
{{ $css_bundle_head := $license | resources.FromString "css/bundle-head.css" }}
|
|
|
{{ $css_options := dict "targetPath" "css/wowchemy.css" }}
|
|
|
{{- if hugo.IsProduction -}}
|
|
@@ -263,6 +264,14 @@
|
|
|
{{ $twitter_card = "summary" }}
|
|
|
{{ end }}
|
|
|
{{ $scr.Set "og_image" $og_image }}{{/* Set `og_image` globally for `rss.xml`. */}}
|
|
|
+
|
|
|
+ {{ $title := "" }}
|
|
|
+ {{ with .Params.seo.title }}
|
|
|
+ {{ $title = replace . "{brand}" site.Title }}
|
|
|
+ {{ else }}
|
|
|
+ {{ $title = .Title | default site.Title }}
|
|
|
+ {{ if ne $title site.Title }}{{ $title = printf "%s | %s" $title site.Title }}{{ end }}
|
|
|
+ {{ end }}
|
|
|
<meta property="twitter:card" content="{{ $twitter_card }}" />
|
|
|
{{ with site.Params.twitter }}
|
|
|
<meta property="twitter:site" content="@{{ . }}" />
|
|
@@ -270,7 +279,7 @@
|
|
|
{{ end }}
|
|
|
<meta property="og:site_name" content="{{ site.Title }}" />
|
|
|
<meta property="og:url" content="{{ .Permalink }}" />
|
|
|
- <meta property="og:title" content="{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}" />
|
|
|
+ <meta property="og:title" content="{{ $title }}" />
|
|
|
<meta property="og:description" content="{{ $desc }}" />
|
|
|
{{- with $og_image -}}
|
|
|
<meta property="og:image" content="{{ . }}" />
|
|
@@ -297,5 +306,5 @@
|
|
|
{{ partial "cookie_consent" . }}
|
|
|
{{ partial "custom_head" . }}
|
|
|
|
|
|
- <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
|
|
|
+ <title>{{$title}}</title>
|
|
|
</head>
|