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

head.html « partials « layouts - github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 41fc462530e3f5c54c9139ca6d124297b34b9b15 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{{ range .Translations }}
<link rel="alternate" hreflang="{{ .Site.LanguageCode }}" href="{{ .Permalink  }}" />
{{ end }}

<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"/>
{{/* support older feature phones
  see: https://stackoverflow.com/questions/1988499/meta-tags-for-mobile-should-they-be-used
  */}}
<meta name="MobileOptimized" content="width"/>
<meta name="HandheldFriendly" content="true"/>

{{/* fit for browsing on mobile devices and PC,
  see : https://ziyuan.baidu.com/college/courseinfo?id=156
*/}}
<meta name="applicable-device" content="pc,mobile">

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">
{{/* Add to homescreen for Chrome on Android */}}
<meta name="mobile-web-app-capable" content="yes">

<!-- author & description & keywords  -->
{{- if or .Params.author .Site.Author.name -}}
{{- $author_id := .Params.author | default .Site.Author.name -}}
{{- $author := (index ($.Site.Data.authors | default dict) $author_id) -}}
{{- $author_lang := (index ($author | default dict) .Site.Language.Lang) -}}
{{- $author_name := $author_lang.name.display | default $author.name.display | default $author_id -}}
<meta name="author" content="{{ $author_name | safeHTML }}" />
{{- end -}}

{{- if .Description -}}
  <meta name="description" content="{{ .Description | safeHTML }}" />
{{ else if .IsPage }}
  <meta name="description" content="{{ .Summary | plainify }}" />
{{ else if .Site.Params.description }}
  <meta name="description" content="{{ .Site.Params.description | safeHTML }}" />
{{- end -}}

{{- if .Keywords -}}
  {{ $length := len .Keywords | add -1 -}}
  <meta name="keywords" content="{{ range $index, $element := .Keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
{{ else if .Site.Params.keywords }}
  {{ $length := len .Site.Params.keywords | add -1 -}}
  <meta name="keywords" content="{{ range $index, $element := .Site.Params.keywords }}{{ $element | safeHTML }}{{if ne $index $length }}, {{ end }}{{ end }}" />
{{- end }}

<!-- baidu & google verification  -->
{{ with .Site.Params.baidu_verification }}<meta name="baidu-site-verification" content="{{.}}" />{{ end }}
{{ with .Site.Params.google_verification }}<meta name="google-site-verification" content="{{.}}" />{{ end }}

<!-- Site Generator -->
<meta name="generator" content="Hugo {{ hugo.Version }}" />

<!-- Permalink & RSSlink -->
<link rel="canonical" href="{{ .Permalink }}" />
{{ with .OutputFormats.Get "RSS" }}<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />{{ end }}

{{ if .OutputFormats.Get "jsonfeed" }}
<link
  href="{{ with .OutputFormats.Get "jsonfeed" }}{{ .Permalink }}{{ end }}"
  rel="alternate" type="application/json" title="{{ .Site.Title }}" />
{{ end }}

<!-- Custom Favicon -->
{{ partial "custom_favicon.html" . }}

<!-- debug -->
{{- if .Site.Params.debug }}
<script src="https://cdn.jsdelivr.net/npm/eruda@1.2.6/eruda.min.js" integrity="sha256-Jmz4bc3kp+rRrXX2tGadNBKFLwtzMapr8kHABxSAAP8=" crossorigin="anonymous"></script>
<script>eruda.init();</script>
{{- end }}

<!-- Jane theme main style -->
{{ $style := resources.Get "sass/jane.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" media="screen" crossorigin="anonymous">
<!-- End -->

<!-- Custom wallpaper (optional) -->
{{- if .Site.Params.wallpaper }}
<style>
  .wallpaper {
    background-image: url('{{ .Site.Params.wallpaper }}');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
  }
</style>
{{- end }}

<!-- custom css -->
{{ range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ "/css/" | relURL }}{{ . }}">
{{ end }}

{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/spf13/hugo/blob/master/tpl/tplimpl/template_embedded.go#L158 */}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}

<!-- Polyfill for old browsers -->
{{ `<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->` | safeHTML }}

{{ `<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->` | safeHTML }}

<!-- Analytics -->
{{- if and (not .Site.IsServer) .Site.GoogleAnalytics -}}
  {{ template "_internal/google_analytics_async.html" . }}
{{- end -}}

<!-- Custom head -->
{{ partial "custom_head.html" . }}