blob: a018bc7f0d6333211e3b86e799692ea72df62220 (
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
|
<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">
<meta name="theme-color" content="black">
{{ 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 }}
{{- $bootstrap_css := resources.Get "css/bootstrap.min.css" -}}
{{- $open_sans_css := resources.Get "css/open-sans.css" -}}
{{- $ubuntu_css := resources.Get "css/ubuntu.css" -}}
{{- $main_css := resources.Get "css/ticky_tacky_dark.css" -}}
{{- $user_css := resources.Get "css/user.css" -}}
{{- $custom_css := slice $bootstrap_css $open_sans_css $ubuntu_css $main_css $user_css | resources.Concat "css/custom.css" | resources.Minify | resources.Fingerprint -}}
<link rel="stylesheet" href="{{ $custom_css.RelPermalink }}" integrity="{{ $custom_css.Data.Integrity }}"/>
{{- 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 randomImg(dest_elem, images) {
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() {
const element = document.getElementById(dest_elem);
element.src = sel_url;
}
if( document.readyState != "loading" ) { set_img() }
else { window.addEventListener("load", set_img); }
}
img.src = sel_url;
}
{{ with .Site.Params.images }}
randomImg(
dest_elem = "headerimg",
images = [
{{- $last_elem := sub (len .) 1 -}}
{{ range $index, $component := . -}}
{{ . | absURL }}{{ if lt $index $last_elem }},{{ end }}
{{- end -}}
]
);
{{ end }}
{{ with .Params.images }}
randomImg(
dest_elem = "sideimage",
images = [
{{- $last_elem := sub (len .) 1 -}}
{{ range $index, $component := . -}}
{{ . | absURL }}{{ if lt $index $last_elem }},{{ end }}
{{- end -}}
]
);
{{ end }}
</script>
|