/
base_helper.tmpl
181 lines (165 loc) · 6.95 KB
/
base_helper.tmpl
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{# -*- coding: utf-8 -*- #}
{% import 'annotation_helper.tmpl' as notes with context %}
{% macro html_headstart() %}
<!DOCTYPE html>
<html
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook') %}
prefix='
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %}
og: http://ogp.me/ns#
{% endif %}
{% if use_open_graph %}
article: http://ogp.me/ns/article#
{% endif %}
{% if comment_system == 'facebook' %}
fb: http://ogp.me/ns/fb#
{% endif %}
'
{% endif %}
{% if is_rtl %}
dir="rtl"
{% endif %}
lang="{{ lang }}">
<head>
<meta charset="utf-8">
{% if description %}
<meta name="description" content="{{ description }}">
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title|e }} | {{ blog_title|e }}</title>
{{ html_stylesheets() }}
{{ html_feedlinks() }}
{% if permalink %}
<link rel="canonical" href="{{ abs_link(permalink) }}">
{% endif %}
{% if favicons %}
{% for name, file, size in favicons %}
<link rel="{{ name }}" href="{{ file }}" sizes="{{ size }}"/>
{% endfor %}
{% endif %}
{% if comment_system == 'facebook' %}
<meta property="fb:app_id" content="{{ comment_system_id }}">
{% endif %}
{% if prevlink %}
<link rel="prev" href="{{ prevlink }}" type="text/html">
{% endif %}
{% if nextlink %}
<link rel="next" href="{{ nextlink }}" type="text/html">
{% endif %}
{{ mathjax_config }}
{% if use_cdn %}
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
{% else %}
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang) }}"></script><![endif]-->
{% endif %}
{{ extra_head_data }}
{% endmacro %}
{% macro late_load_js() %}
{% if use_bundles %}
{% if use_cdn %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="/assets/js/all.js"></script>
{% else %}
<script src="/assets/js/all-nocdn.js"></script>
{% endif %}
{% else %}
{% if use_cdn %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
{% else %}
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/assets/js/moment-with-locales.min.js"></script>
<script src="/assets/js/fancydates.js"></script>
{% endif %}
<script src="/assets/js/jquery.colorbox-min.js"></script>
{% endif %}
{% if colorbox_locales[lang] %}
<script src="/assets/js/colorbox-i18n/jquery.colorbox-{{ colorbox_locales[lang] }}.js"></script>
{% endif %}
{{ social_buttons_code }}
{% endmacro %}
{% macro html_stylesheets() %}
{% if use_bundles %}
{% if use_cdn %}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
{% else %}
<link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
{% endif %}
{% else %}
{% if use_cdn %}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
{% else %}
<link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
{% endif %}
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
<link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css">
<link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
{% if has_custom_css %}
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
{% endif %}
{% endif %}
{% if needs_ipython_css %}
<link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">
<link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
{% endif %}
{% if annotations and post and not post.meta('noannotations') %}
{{ notes.css() }}
{% elif not annotations and post and post.meta('annotations') %}
{{ notes.css() }}
{% endif %}
{% endmacro %}
{% macro html_navigation_links() %}
{% for url, text in navigation_links[lang] %}
{% if isinstance(url, tuple) %}
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ text }} <b class="caret"></b></a>
<ul class="dropdown-menu">
{% for suburl, text in url %}
{% if rel_link(permalink, suburl) == "#" %}
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
{% else %}
<li><a href="{{ suburl }}">{{ text }}</a>
{% endif %}
{% endfor %}
</ul>
{% else %}
{% if rel_link(permalink, url) == "#" %}
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
{% else %}
<li><a href="{{ url }}">{{ text }}</a>
{% endif %}
{% endif %}
{% endfor %}
{% endmacro %}
{% macro html_feedlinks() %}
{% if rss_link %}
{{ rss_link }}
{% elif generate_rss %}
{% if translations|length > 1 %}
{% for language in translations|sort %}
<link rel="alternate" type="application/rss+xml" title="RSS ({{ language }})" href="{{ _link('rss', None, language) }}">
{% endfor %}
{% else %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
{% endif %}
{% endif %}
{% if generate_atom %}
{% if translations|length > 1 %}
{% for language in translations|sort %}
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
{% endfor %}
{% else %}
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
{% endif %}
{% endif %}
{% endmacro %}
{% macro html_translations() %}
{% for langname in translations|sort %}
{% if langname != lang %}
<li><a href="{{ abs_link(_link("root", None, langname)) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></li>
{% endif %}
{% endfor %}
{% endmacro %}