|
@@ -12,6 +12,26 @@
|
|
<meta name="robots" content="noindex" />
|
|
<meta name="robots" content="noindex" />
|
|
{{- end -}}
|
|
{{- 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 }}
|
|
{{ if site.Params.marketing.google_optimize | and hugo.IsProduction }}
|
|
<script src="https://www.googleoptimize.com/optimize.js?id={{ site.Params.marketing.google_optimize }}"></script>
|
|
<script src="https://www.googleoptimize.com/optimize.js?id={{ site.Params.marketing.google_optimize }}"></script>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
@@ -61,13 +81,6 @@
|
|
{{ end }}
|
|
{{ end }}
|
|
<link rel="alternate" hreflang="{{ site.LanguageCode | default "en-us" }}" href="{{ .Permalink }}" />
|
|
<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 }}
|
|
{{ $css := site.Data.assets.css }}
|
|
{{ $js := site.Data.assets.js }}
|
|
{{ $js := site.Data.assets.js }}
|
|
{{ if ne ($scr.Get "primary") "#fff" }}
|
|
{{ if ne ($scr.Get "primary") "#fff" }}
|
|
@@ -179,21 +192,6 @@
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ 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 := 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/*! Copyright 2016-present George Cushen (https://georgecushen.com/) */\n" }}
|
|
{{ $license := $license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */\n" }}
|
|
{{ $license := $license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */\n" }}
|