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

head.html « partials « layouts - github.com/tastaturtier/someparts-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15e6dbc6ba6d8b3581ba4d6c6eb9ed6c0803ae5f (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

    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      {{ hugo.Generator }}
      {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
      {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
      {{ with .OutputFormats.Get "rss" -}}{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}{{ end -}}
      <link rel="stylesheet" href="/css/bootstrap.min.css" />
      <script src="/js/jquery.min.js"></script>
      <script src="/js/popper.min.js"></script>
      <script src="/js/bootstrap.min.js"></script>
      <link rel="stylesheet" href="/css/font-awesome.min.css">
      {{ if .IsHome }}{{ $homepage := "Home" }}<title>{{ .Site.Params.Title }}</title>{{ else }}<title>{{ .Title }} | {{ .Site.Params.Title }}</title>{{ end }}
      <style>
        article {
          padding-top: 80px;
          padding-bottom: 1ex;
        }
        @media print {
          .custom-navbar {
            display: none;
          }
        }
        img {
          max-width: 100%;
        }
      </style>
{{ if not .Site.IsServer }}
{{ if .Site.Params.googleAnalytics }}<link rel="stylesheet" type="text/css" href="/css/cookieconsent.min.css" />
<script src="/js/cookieconsent.min.js"></script>
<script>
function loadGAonConsent(){
  window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', '{{ .Site.Params.googleAnalytics }}', { 
      'cookie_domain': 'auto',
      'cookie_expires': 7 * 26 * 24 * 60 * 60, 
      'anonymize_ip': true 
    });
  var gascript = document.createElement("script");
  gascript.async = true;
  gascript.src = "https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.googleAnalytics }}";
  document.getElementsByTagName("head")[0].appendChild(gascript, document.getElementsByTagName("head")[0]);               
}
 
if (document.cookie.split(';').filter(function(item) {
    return item.indexOf('cookieconsent_status=allow') >= 0
}).length) {
    loadGAonConsent();
}
window.addEventListener("load", function(){
	window.cookieconsent.initialise({
		"palette": {
		"popup": { "background": "#000"},
		"button": { "background": "#f1d600"}
		},
		"theme": "classic",
		"type": "opt-in",
		"content": {
		"message": "{{ .Site.Params.cookieconsent.message }}",
		"deny": "{{ .Site.Params.cookieconsent.denyLabel }}",
		"allow": "{{ .Site.Params.cookieconsent.allowLabel }}",
		"link": "{{ .Site.Params.cookieconsent.policy.linktext }}",
		"href": "{{ .Site.Params.cookieconsent.policy.url }}"
		},
		onStatusChange: function(status, chosenBefore) {
		var type = this.options.type;
		var didConsent = this.hasConsented();
		if (type == 'opt-in' && didConsent) {
		// enable cookies
		loadGAonConsent();
		}
		}
	})
});
</script>
{{ end }}
{{ end }}
    </head>