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

head.html « partials « layouts - github.com/kc0bfv/ticky_tacky_dark.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75ceab970903e00b3ba191adfdbb7f4b17e17d7e (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{{ .Site.Title }}{{ with .Params.title }} - {{ . }}{{ end }}</title>
{{ $description := $.Param "description" }}
{{- with $description }}<meta name="description" content="{{ . }}">{{ end }}
{{ $author := .Params.author.name | default .Site.Author.name }}
{{- with $author }}<meta name="author" content="{{ . }}">{{ end }}
<link rel="icon" href="{{ .Site.Params.favicon | relURL }}">
{{- template "_internal/opengraph.html" . }}
{{- template "_internal/twitter_cards.html" . }}
{{ with .Params.actualurl -}}
<meta http-equiv="refresh" content="0;URL='{{ . | relURL }}'" />
{{- end }}
<meta name="robots" content="index,follow">
<meta name="referrer" content="origin-when-cross-origin">
{{ with .Site.Params.googlesiteverification }}<meta name="google-site-verification" content="{{ . }}">{{ end }}
{{ with .Site.Params.msvalidate }}<meta name="msvalidate.01" content="{{ . }}">{{ end }}
{{ hugo.Generator }}
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!--My CSS-->
<link rel="stylesheet" href="{{ "css/myscreen.css" | relURL }}" type="text/css" media="screen">
<link rel="stylesheet" href="{{ "css/myprint.css" | relURL }}" type="text/css" media="print">
<meta name="theme-color" content="black">
{{- template "_internal/google_analytics_async.html" . }}

<noscript>
    <style>
        {{ with .Site.Params.images }}
            #headerimg {
                background-image: url({{ index . 0 | safeURL | absURL }});
                background-size: cover;
            }
        {{ end }}
        {{ with .Params.images }}
            #sideimage {
                background-image: url({{ index . 0 | safeURL | absURL }});
                background-size: cover;
            }
        {{ end }}
    </style>
</noscript>

<script>
    function toggleDisplay( elementID ) {
        elem = document.getElementById(elementID);
        if( elem.style.display == "none" ) {
            elem.style.display = "block";
        } else if( elem.style.display == "block" ) {
            elem.style.display = "none";
        }
    }
    {{ with .Site.Params.images }}
    function randomHeaderImg() {
        let images = [
            {{- $last_elem := sub (len .) 1 -}}
            {{ range $index, $component := . -}}
                {{ . | absURL }}{{ if lt $index $last_elem }},{{ end }}
            {{- end -}}
        ];
        let img_ind = Math.ceil(Math.random() * images.length) - 1;
        let sel_url = images[img_ind]
        let img = new Image();
        img.onload = function() {
            function set_img(old_onload) {
                let element = document.getElementById("headerimg");
                element.src = sel_url;
                if( old_onload ){ old_onload() }
            }
            if( document.readyState === "complete" ) { set_img() }
            else { window.onload = set_img(window.onload) }
        }
        img.src = sel_url;
    }
    randomHeaderImg();
    {{ end }}
    {{ with .Params.images }}
    function randomSideImg() {
        let images = [
            {{- $last_elem := sub (len .) 1 -}}
            {{ range $index, $component := . -}}
                {{ . | absURL }}{{ if lt $index $last_elem }},{{ end }}
            {{- end -}}
        ];
        let img_ind = Math.ceil(Math.random() * images.length) - 1;
        let sel_url = images[img_ind]
        let img = new Image();
        img.onload = function() {
            function set_img(old_onload) {
                let element = document.getElementById("sideimage");
                element.src = sel_url;
                if( old_onload ){ old_onload() }
            }
            if( document.readyState === "complete" ) { set_img() }
            else { window.onload = set_img(window.onload) }
        }
        img.src = sel_url;
    }
    randomSideImg();
    {{ end }}
</script>