/
head.html
93 lines (86 loc) · 3.69 KB
/
head.html
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">
<link href="https://www.clarity.ms" rel="preconnect" >
{{ if .NextInSection }}
<link rel="next" href="{{ .NextInSection.RelPermalink }}">{{ end }}
{{ if .PrevInSection }}
<link rel="prev" href="{{ .PrevInSection.RelPermalink }}">{{ end }}
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author"
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}">
<meta name="description"
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}{{ end }}" />
<meta name="keywords" content="{{ .Site.Params.keywords }}" />
{{ if or (eq .Type "tags") (eq .Type "blog")}}<meta name="robots" content="noindex" />{{ end }}
<link rel="canonical" href="{{ .Permalink }}" />
{{ block "title" . }}
<title>
{{ if .IsHome }}
{{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }}
{{ else }}
{{ .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}
{{ end }}
</title>
{{ end }}
{{ $searchURL := printf "%s%s" $.Site.BaseURL "search/?q={search_term_string}" }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": {{ .Permalink }},
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": {{ $searchURL }}
},
"query-input": "required name=search_term_string"
}
}
</script>
{{ if .Site.Params.hasTranslations }}
<!-- CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.1/css/flag-icon.min.css" rel="stylesheet"
type="text/css">
{{ end }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<!--{{if .IsHome }}
{{ with resources.Get "css/min.css" | resources.Minify }} <style>{{ .Content | safeCSS }}</style> {{ end }}
{{ else }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ end }}
-->
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ range $val := $.Site.Params.customCSS }}
{{ if gt (len $val) 0 }}
<link rel="stylesheet" type="text/css" href="{{ $val }}">
{{ end }}
{{ end }}
<!-- Icons -->
{{- partial "favicons.html" }}
{{- template "_internal/schema.html" . }}
{{- template "_internal/twitter_cards.html" . }}
{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />{{ end }}
{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />{{ end }}
<!-- RSS -->
{{ if .OutputFormats.Get "RSS" }}
<link href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
<!-- JSON Feed -->
{{ if .OutputFormats.Get "json" }}
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate"
type="application/json" title="{{ .Site.Title }}" />
{{ end }}
<!-- Custom head tags -->
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}
<script type="text/javascript">
(function (c, l, a, r, i, t, y) {
c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", {{.Site.Params.Clarity }});
</script>