Welcome to mirror list, hosted at ThFree Co, Russian Federation.

head.html « partials « layouts - github.com/Softorage/HugoTheme-VibrantShadows.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c54327dbe204be4b08b6e13068cdebf32e7940c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<head>
  <!-- Basic head tags -->
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>
  {{- .Title | default site.Title }} {{- default " | " site.Params.meta.titleSeparator -}} {{ if not .IsHome }}{{ site.Title }}{{ else }}{{ site.Params.meta.tagline }}{{ end -}}
  </title>
  
  <!-- Googe Analytics, Cookie Consent should work only on production website -->
  {{ if eq hugo.Environment "production" -}}
    {{ if site.GoogleAnalytics }}
      <!-- Google Analytics shall work only on production website -->
      <!-- prefetch -->
      <link rel="dns-prefetch" href="https://www.googletagmanager.com/">
      <link rel="preconnect" href="https://www.googletagmanager.com/" crossorigin>
      <link rel="dns-prefetch" href="https://www.google-analytics.com/">
      <link rel="preconnect" href="https://www.google-analytics.com/" crossorigin>
      
      {{ if and (eq site.Params.cookieConsent.switch "on") (eq site.Params.cookieConsent.type "opt-in") }}
      <script>
      // Disable tracking by default
      window['{{ printf "%s%s" "ga-disable-" site.GoogleAnalytics }}'] = true;
      </script>
      {{ end }}
      
      {{ if ne site.Params.userExperience.googleAnalyticsLoading "async" }}
        {{ template "_internal/google_analytics.html" . }}
      {{ else }}
        {{ template "_internal/google_analytics_async.html" . }}
      {{ end }}
    {{ end }}
    {{ if ne site.Params.seo.switch "off" }}
      <!-- SEO tag -->
      {{- partial "seo.html" . -}}
    {{ end }}
    <!-- Hugo's Tag shall work only on production website -->
    {{ hugo.Generator }}
  {{- else }}
    {{ if ne site.Params.seo.switch "off" }}
      <!-- SEO tag -->
      {{- partial "seo.html" . -}}
    {{ end }}
  {{- end }}
  
  <!-- Minified Aggregated CSS -->
  {{- $css := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "/assets/css/main.scss" . | toCSS }}
  <!-- Run PostCSS on $css, only if on Production Environment, since its builds take considerably more time -->
  {{ if and (eq hugo.Environment "production") (eq site.Params.seo.speedMode "enable") -}}
    {{- $css = $css | postCSS | fingerprint | resources.PostProcess }}
  {{- else }}
    {{- $css = $css | minify | fingerprint }}
  {{- end }}
  
  <link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous">
  <!-- Prefetch and Preconnect Google Fonts API -->
  <link rel="dns-prefetch" href="//fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
  
  <!-- AMP, RSS Feed, and other output formats -->
  {{- range .AlternativeOutputFormats -}}
    {{- printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
  {{- end -}}
  
  {{ if site.Params.faviconTags }}
    {{- $faviconTags := site.Params.faviconTags | resources.FromString "/favicon-temp.html" | resources.ExecuteAsTemplate "/favicon-temp.html" . | minify }}
    {{- $faviconTags.Content | safeHTML }}
  {{- end }}
  
  <!-- Address bar color -->
  <!-- Chrome, Firefox OS and Opera -->
  <meta name="theme-color" content="#fff6f8">
  <!-- Windows Phone -->
  <meta name="msapplication-navbutton-color" content="#fff6f8">
  <!-- iOS Safari -->
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  
  {{ if site.Params.customVerification.myWOT }}
  <!-- WOT Verification -->
  <meta name="wot-verification" content="{{ site.Params.customVerification.myWOT }}" />
  {{ end }}
</head>