forked from MeiK2333/github-style
-
Notifications
You must be signed in to change notification settings - Fork 1
/
head.html
93 lines (80 loc) · 4.22 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
<head>
<meta charset="utf-8">
<link crossorigin="anonymous" media="all"
rel="stylesheet"
href='{{ printf "%s?%s" ("css/frameworks.css" | absURL) (now.Format "20060102150405") }}' />
<link crossorigin="anonymous" media="all"
rel="stylesheet" href='{{ printf "%s?%s" ("css/github.css" | absURL) (now.Format "20060102150405") }}' />
<link crossorigin="anonymous" media="all"
rel="stylesheet" href='{{ printf "%s?%s" ("css/user.css" | absURL) (now.Format "20060102150405") }}'/>
{{ if $.Site.Params.disableDarkMode }}
{{ else }}
<link crossorigin="anonymous" media="(prefers-color-scheme: dark)" rel="stylesheet"
href="{{ "css/dark.css" | absURL }}" />
{{ end }}
{{ if $.IsPage }}
<!-- 記事中の画像をポップアップ表示する -->
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="{{ "css/lightbox.css" | absURL }}" />
<!-- シンタックスハイライトを使用する -->
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="{{ "css/syntax-highlight.css" | absURL }}" />
{{ end }}
<meta name="viewport" content="width=device-width">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.Description }}{{ else }}{{ .Params.Description }}{{ end }}" />
<meta name="keywords"
content="{{ with .Params.Tags }}{{ delimit . ", " }}{{ else }}{{ with $.Site.Params.Keywords }}{{ delimit . ", " }}{{ end }}{{ end }}" />
<link rel="canonical" href="{{ .Permalink }}" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ if .IsHome }}{{ else }}{{ .Title }} - {{ end }}{{ .Site.Title }}" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.description }}{{ else }}{{ .Params.Description }}{{ end }}" />
<meta name="twitter:site" content="{{ $.Site.BaseURL }}" />
<meta name="twitter:creator" content="{{ .Params.Author }}" />
<meta name="twitter:image" content="{{ if .IsHome }}{{ $.Site.Params.avatar | absURL }}{{ else }}{{ .Params.Cover | absURL }}{{ end }}">
<!-- OGP -->
<meta property="og:url" content="{{ .Permalink | absURL }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>
{{- if .IsHome }}
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ .Site.Title }}" />
<meta property="og:description" content="{{ .Site.Params.Description }}"/>
<meta property="og:image" content="{{ $.Site.Params.avatar }}"/>
{{- else }}
<meta property="og:type" content="article" />
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ .Params.Description }}"/>
{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{ end }}
{{- end }}
<!-- RSS -->
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
<!-- JSON Feed -->
{{ with .OutputFormats.Get "json" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}" />
{{ end }}
<title>{{ if .IsHome }}{{ else }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
<!-- noindex:true が指定されたページは検索除けする -->
{{- if .Params.noindex }}
<meta name=”robots” content=”noindex”>
{{- end }}
<link rel="icon" type="image/x-icon" class="js-site-favicon" href='{{ "/favicon.ico" | absURL }}'>
<link rel="shortcut icon" href='{{ "/favicon.ico" | absURL }}'/>
<meta name="theme-color" content="#1e2327">
{{- if not .Site.IsServer }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ .Site.GoogleAnalytics }}');
</script>
<!-- {{ template "_internal/google_analytics_async.html" . }} -->
{{- end }}
<!-- Extended head section-->
{{ partial "extended_head.html" . }}
</head>