-
Notifications
You must be signed in to change notification settings - Fork 150
/
head.html
152 lines (134 loc) · 7.9 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!-- Site & Page Meta Data -->
{{- $gohugoio := "gohugoio" -}}
{{- $themeColor := "#02b875" -}}
{{- $favicon := "favicon.ico" -}}
{{- $icon16 := "icons/icon-16x16.png" -}}
{{- $icon32 := "icons/icon-32x32.png" -}}
{{- $icon144 := "icons/icon-144x144.png" -}}
{{- $icon152 := "icons/icon-152x152.png" -}}
{{- $icon192 := "icons/icon-192x192.png" -}}
{{- $manifest := "manifest.json" -}}
{{- $bg := resources.Get (.Site.Params.bg | default "images/grey-prism.svg") -}}
{{- $avatar := resources.Get (.Site.Params.avatar | default "images/avatar.png") -}}
{{- $style := resources.Get "styles/main.scss" | resources.ExecuteAsTemplate "styles/main-rendered.scss" . | resources.ToCSS | resources.Minify -}}
{{- $customStyle := resources.Get (.Site.Params.customStyle | default "styles/custom.scss") | resources.ToCSS | resources.Minify -}}
{{- $fontAwesome := "https://use.fontawesome.com/releases/v5.8.1/css/all.css" -}}
{{- $fontAwesomeIntegrity := "sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" -}}
<!-- DNS Prefetch -->
<link href="//cdn.jsdelivr.net" rel="dns-prefetch">
<link href="//cdnjs.cloudflare.com" rel="dns-prefetch">
{{ with .Site.Params.fontAwesome }}
<link href="//use.fontawesome.com" rel="dns-prefetch">
{{ else }}
<link href="//at.alicdn.com" rel="dns-prefetch">
{{ end }}
<link href="//fonts.googleapis.com" rel="dns-prefetch">
<link href="//fonts.gstatic.com" rel="dns-prefetch">
{{ with .Site.DisqusShortname }}<link href="///disqus.com" rel="dns-prefetch">{{ end }}
{{ with .Site.DisqusShortname }}<link href="//c.disquscdn.com" rel="dns-prefetch">{{ end }}
{{ with .Site.Params.Gitment }}<link href="//imsun.github.io" rel="dns-prefetch">{{ end }}
{{ with .Site.GoogleAnalytics }}<link href="//www.google-analytics.com" rel="dns-prefetch">{{ end }}
{{ with .Site.Params.baidutongji }}<link href="//hm.baidu.com" rel="dns-prefetch">{{ end }}
{{ if and (eq .Kind "page") (eq .Type "post") }}
<!-- Page Author & Description -->
{{ with .Params.author }}<meta name="author" content="{{ . }}">{{ end }}
<meta name="description" content="{{ .Summary | plainify }}">
<!-- Twitter Card -->
{{ if isset .Params "cover" }}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@{{ .Site.Params.twitter | default $gohugoio }}">
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ .Summary | plainify }}">
<meta name="twitter:image" content="{{ .Params.cover | absURL }}">
{{ else }}
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@{{ .Site.Params.twitter | default $gohugoio }}">
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ .Summary | plainify }}">
<meta name="twitter:image" content="{{ $avatar.RelPermalink }}">
{{ end }}
<!-- Facebook Open Graph -->
<meta property="og:type" content="article">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ .Summary | plainify }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:image" content="{{ if isset .Params "cover" }}{{ .Params.cover | absURL }}{{ else }}{{ $avatar.RelPermalink }}{{ end }}">
{{ else }}
<!-- Site Author & Description -->
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@{{ .Site.Params.twitter | default $gohugoio }}">
<meta name="twitter:title" content="{{ if isset .Site.Params "seotitle" }}{{ .Site.Params.seotitle }}{{ else }}{{ .Site.Title }}{{ end }}">
{{ with .Site.Params.description }}<meta name="twitter:description" content="{{ . }}">{{ end }}
<meta name="twitter:image" content="{{ $avatar.RelPermalink }}">
<!-- Facebook Open Graph -->
<meta property="og:type" content="website">
<meta property="og:title" content="{{ if isset .Site.Params "seotitle" }}{{ .Site.Params.seotitle }}{{ else }}{{ .Site.Title }}{{ end }}">
{{ with .Site.Params.description }}<meta property="og:description" content="{{ . }}">{{ end }}
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:image" content="{{ $avatar.RelPermalink }}">
{{ end }}
<!-- Site Generator -->
<meta name="generator" content="Hugo {{ .Hugo.Version }}">
<!-- Permalink & RSSlink -->
<link rel="canonical" href="{{ .Permalink }}">
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<!-- Rending Prefs -->
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<meta http-equiv="Cache-Control" content="no-transform">
<!-- SEO Prefs -->
<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 }}
{{ with .Site.Params.baidusiteverification }}<meta name="baidu-site-verification" content="{{ . }}">{{ end }}
{{ with .Site.Params.sogousiteverification }}<meta name="sogou_site_verification" content="{{ . }}">{{ end }}
{{ with .Site.Params.sositeverification }}<meta name="360-site-verification" content="{{ . }}">{{ end }}
<!-- Favicon and Touch icons -->
<meta name="theme-color" content="{{ $themeColor }}">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Title }}">
<meta name="msapplication-tooltip" content="{{ .Site.Title }}">
<meta name='msapplication-navbutton-color' content="{{ $themeColor }}">
<meta name="msapplication-TileColor" content="{{ $themeColor }}">
<meta name="msapplication-TileImage" content="{{ $icon144 | relURL }}">
<link rel="icon" href="{{ $favicon | relURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $icon16 | relURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ $icon32 | relURL }}">
<link rel="icon" sizes="192x192" href="{{ $icon192 | relURL }}">
<link rel="apple-touch-icon" href="{{ $icon152 | relURL }}">
<link rel="manifest" href="{{ $manifest | relURL }}">
<!-- Preload -->
<link rel="preload" href="{{ $style.RelPermalink }}" as="style">
<!-- FontAwesome is not preloaded because we use integrity and https://bugs.chromium.org/p/chromium/issues/detail?id=677022 -->
{{ with .Site.Params.customStyle }}<link rel="preload" href="{{ $customStyle.RelPermalink }}" as="style">{{ end }}
<link rel="preload" href="https://fonts.googleapis.com/css?family=Lobster" as="style">
<link rel="preload" href="{{ $avatar.RelPermalink }}" as="image">
<link rel="preload" href="{{ $bg.RelPermalink }}" as="image">
<!-- Main Styles -->
<style>
body {
background: rgb(244, 243, 241) url('{{ $bg.RelPermalink }}') repeat fixed;
}
</style>
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ with .Site.Params.fontAwesome }}
<link rel="stylesheet" href="{{ $fontAwesome }}" {{ printf "integrity=%q" $fontAwesomeIntegrity | safeHTMLAttr }} crossorigin="anonymous">
{{ end }}
{{ with .Site.Params.customStyle }}<link rel="stylesheet" href="{{ $customStyle.RelPermalink }}">{{ end }}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">
<!-- Medium Zoom -->
{{ if and (eq .Kind "page") (eq .Type "post") }}
<script src="https://cdn.jsdelivr.net/npm/medium-zoom@1.0.2/dist/medium-zoom.min.js"></script>
{{ end }}
<!-- Video.js Styles -->
{{ if and (eq .Kind "page") (eq .Type "post") }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/video.js@7.3.0/dist/video-js.min.css">
{{ end }}