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
|
{#- Theme Switcher Button to toggle between dark/light #}
{%- set integrity = config.extra.integrity | default(value=true) -%}
{%- if config.extra.offline %}{% set integrity = false %}{% endif %}
{%- if config.extra.js_switcher | default(value=true) %}
{%- set js_theme="js/theme.min.js" %}
{%- if config.extra.js_switcher_default %}
{%- if config.extra.js_switcher_default == "light" %}{% set js_theme="js/theme_light.min.js" %}{% endif %}
{%- endif %}
<script src="{{ get_url(path=js_theme , trailing_slash=false) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=js_theme, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}
{#- Style Sheets #}
{%- set stylesheets=config.extra.stylesheets | default(value=[ "abridge.css" ]) -%}
{%- if stylesheets %}{%- for i in stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=i , trailing_slash=false, cachebust=true) | safe }}" />
{%- endfor %}{%- endif %}
{#- meta tags #}
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="base" content="{{ config.base_url | safe }}" />
<meta name="HandheldFriendly" content="True" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
{#- Security: CSP, referrer #}
{%- if config.extra.security_header_referrer %}
<meta name="referrer" content="{{ config.extra.security_header_referrer | safe }}" />
{%- endif %}
{%- if config.extra.security_header_csp %}
<meta http-equiv="Content-Security-Policy" content="{{ config.extra.security_header_csp | safe }}" />
{%- endif %}
{#- Favicons #}
{%- if config.extra.favicon_theme_color %}
<meta name="theme-color" content="{{ config.extra.favicon_theme_color }}" />
{%- endif %}
{%- if config.extra.favicon_ms_color %}
<meta name="msapplication-TileColor" content="{{ config.extra.favicon_ms_color }}" />
{%- endif %}
{%- if config.extra.webmanifest %}
<link rel="manifest" href="{{ get_url(path=config.extra.webmanifest, trailing_slash=false) | safe }}" />
{%- endif %}
{%- if config.extra.favicon_mask and config.extra.favicon_mask_color %}
<link rel="mask-icon" href="{{ get_url(path=config.extra.favicon_mask, trailing_slash=false) | safe }}" color="{{ config.extra.favicon_mask_color }}" />
{%- endif %}
{%- if config.extra.favicon_svg %}
<link rel="icon" type="image/svg+xml" href="{{ get_url(path=config.extra.favicon_svg, trailing_slash=false) | safe }}" />
{%- endif %}
{%- if config.extra.favicon180 %}
<link rel="apple-touch-icon" sizes="180x180" href="{{ get_url(path=config.extra.favicon180, trailing_slash=false) | safe }}" />
{%- endif %}
{%- if config.extra.favicon32 %}
<link rel="icon" type="image/png" sizes="32x32" href="{{ get_url(path=config.extra.favicon32, trailing_slash=false) | safe }}" />
{%- endif %}
{%- if config.extra.favicon16 %}
<link rel="icon" type="image/png" sizes="16x16" href="{{ get_url(path=config.extra.favicon16, trailing_slash=false) | safe }}" />
{%- endif %}
{#- Style Sheets Preload #}
{%- set integrity = config.extra.integrity | default(value=true) -%}
{%- if config.extra.offline %}{% set integrity = false %}{% endif %}
{%- if config.extra.fonts %}{%- for i in config.extra.fonts %}
{%- if i.url is matching("^http[s]?://") %}
<link rel="preload" as="style" class="preStyle" href="{{ i.url | safe }}" crossorigin="anonymous" />
{%- else %}
<link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false) | safe }}" type="font/woff2" />
{%- endif %}
{%- endfor %}{%- endif %}
{%- if config.extra.fontawesome %}
<link rel="preload" as="style" class="preStyle" href="{{ config.extra.fontawesome | safe }}" crossorigin="anonymous" />
{%- endif %}
{%- if config.extra.math or page.extra.math %}
{%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%}
{%- if katex_css %}{%- if katex_css is matching("^http[s]?://") %}
<link rel="preload" as="style" class="preStyle" href="{{ katex_css | safe }}"{%- if integrity and config.extra.katex_css_integrity %} integrity="{{ config.extra.katex_css_integrity | safe }}"{%- endif %} crossorigin="anonymous" />
{%- else %}
<link rel="preload" as="style" class="preStyle" href="{{ get_url(path=katex_css, trailing_slash=false) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_css, sha_type=384, base64=true) | safe }}"{%- endif %} />
{%- endif %}{%- endif %}
{%- endif %}
{#- Rss / Atom Feed #}
{%- if config.generate_feeds %}
{%- for feed in config.feed_filenames %}
{%- if feed is containing('atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}
{%- if feed is containing('rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}
{%- endfor %}
{%- endif %}
{#- End of head partial -#}
|