summaryrefslogtreecommitdiff
path: root/themes/erdgeist/templates/base_helper.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'themes/erdgeist/templates/base_helper.tmpl')
-rw-r--r--themes/erdgeist/templates/base_helper.tmpl168
1 files changed, 168 insertions, 0 deletions
diff --git a/themes/erdgeist/templates/base_helper.tmpl b/themes/erdgeist/templates/base_helper.tmpl
new file mode 100644
index 0000000..bec4b78
--- /dev/null
+++ b/themes/erdgeist/templates/base_helper.tmpl
@@ -0,0 +1,168 @@
1## -*- coding: utf-8 -*-
2
3<%namespace name="notes" file="annotation_helper.tmpl" import="*" />
4<%def name="html_headstart()">
5<!DOCTYPE html>
6<html
7\
8% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook'):
9prefix='\
10%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
11og: http://ogp.me/ns# \
12%endif
13%if use_open_graph:
14article: http://ogp.me/ns/article# \
15%endif
16%if comment_system == 'facebook':
17fb: http://ogp.me/ns/fb# \
18%endif
19'\
20%endif
21\
22% if is_rtl:
23dir="rtl" \
24% endif
25\
26lang="${lang}">
27 <head>
28 <meta charset="utf-8">
29 %if description:
30 <meta name="description" content="${description}">
31 %endif
32 <meta name="viewport" content="width=device-width, initial-scale=1">
33 <title>${title|striphtml} | ${blog_title|striphtml}</title>
34
35 ${html_stylesheets()}
36 ${html_feedlinks()}
37 %if permalink:
38 <link rel="canonical" href="${abs_link(permalink)}">
39 %endif
40
41 %if favicons:
42 %for name, file, size in favicons:
43 <link rel="${name}" href="${file}" sizes="${size}"/>
44 %endfor
45 %endif
46
47 % if comment_system == 'facebook':
48 <meta property="fb:app_id" content="${comment_system_id}">
49 % endif
50
51 %if prevlink:
52 <link rel="prev" href="${prevlink}" type="text/html">
53 %endif
54 %if nextlink:
55 <link rel="next" href="${nextlink}" type="text/html">
56 %endif
57
58 ${mathjax_config}
59 %if use_cdn:
60 <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
61 %else:
62 <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
63 %endif
64
65 ${extra_head_data}
66</%def>
67
68<%def name="late_load_js()">
69 %if use_bundles:
70 %if use_cdn:
71 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
72 <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
73 <script src="/assets/js/all.js"></script>
74 %else:
75 <!--script src="/assets/js/all-nocdn.js"></script-->
76 %endif
77 %else:
78 %if use_cdn:
79 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
80 <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
81 %else:
82 <script src="/assets/js/jquery.min.js"></script>
83 <script src="/assets/js/bootstrap.min.js"></script>
84 <script src="/assets/js/moment-with-locales.min.js"></script>
85 <script src="/assets/js/fancydates.js"></script>
86 %endif
87 <script src="/assets/js/jquery.colorbox-min.js"></script>
88 %endif
89 %if colorbox_locales[lang]:
90 <script src="/assets/js/colorbox-i18n/jquery.colorbox-${colorbox_locales[lang]}.js"></script>
91 %endif
92 ${social_buttons_code}
93</%def>
94
95
96<%def name="html_stylesheets()">
97 %if use_bundles:
98 %if use_cdn:
99 <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
100 <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
101 %else:
102 <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
103 %endif
104 %else:
105 %if use_cdn:
106 <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
107 %else:
108 <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
109 %endif
110 <link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
111 <link href="/assets/css/code.css" rel="stylesheet" type="text/css">
112 <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css">
113 <link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
114 %if has_custom_css:
115 <link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
116 %endif
117 %endif
118 % if annotations and post and not post.meta('noannotations'):
119 ${notes.css()}
120 % elif not annotations and post and post.meta('annotations'):
121 ${notes.css()}
122 % endif
123</%def>
124
125<%def name="html_navigation_links()">
126 %for url, text, icon in navigation_links[lang]:
127 % if isinstance(url, tuple):
128 <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">${text}<b class="caret"></b></a>
129 <ul class="dropdown-menu">
130 %for suburl, text in url:
131 % if rel_link(permalink, suburl) == "#":
132 <li class="active"><a href="${permalink}" title="${text}"><i class="${icon}"></i></a>
133 %else:
134 <li><a href="${suburl}" title="${text}"><i class="${icon}"></i></a>
135 %endif
136 %endfor
137 </ul>
138 % else:
139 % if rel_link(permalink, url) == "#":
140 <li class="active"><a href="${permalink}" title="${text}"><i class="${icon}"></i></a>
141 %else:
142 <li><a href="${url}" title="${text}"><i class="${icon}"></i></a>
143 %endif
144 % endif
145 %endfor
146</%def>
147
148<%def name="html_feedlinks()">
149 %if rss_link:
150 ${rss_link}
151 %elif generate_rss:
152 %if len(translations) > 1:
153 %for language in translations:
154 <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
155 %endfor
156 %else:
157 <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
158 %endif
159 %endif
160</%def>
161
162<%def name="html_translations()">
163 %for langname in translations.keys():
164 %if langname != lang:
165 <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
166 %endif
167 %endfor
168</%def>