blob: 391350d60f1b0c184bae5477badc5f6f4a205f75 (
plain) (
blame)
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
|
## -*- coding: utf-8 -*-
<%def name="html_title()">
<h1 class="p-name" itemprop="headline name">${title|h}</h1>
% if link:
<p><a href='${link}'>${messages("Original site")}</a></p>
% endif
</%def>
<%def name="html_translations(post)">
%if len(translations) > 1:
%for langname in translations.keys():
%if langname != lang and post.is_translation_available(langname):
|
<a href="${post.permalink(langname)}" rel="alternate" hreflang="${langname}">${messages("Read in English", langname)}</a>
%endif
%endfor
%endif
</%def>
<%def name="meta_translations(post)">
%if len(translations) > 1:
%for langname in translations.keys():
%if langname != lang and post.is_translation_available(langname):
<link rel="alternate" hreflang="${langname}" href="${post.permalink(langname)}">
%endif
%endfor
%endif
</%def>
<%def name="html_list_tags(post)" buffered="True">
<span itemprop="keywords">
%for tag in post.tags:
<a class="tag p-category" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a>
%endfor
</span>
</%def>
<%def name="html_tags(post)">
%if post.tags:
|
${formatmsg(messages("More posts about %s"), html_list_tags(post))}
%endif
</%def>
<%def name="html_pager(post)">
%if post.prev_post or post.next_post:
<ul class="pager">
%if post.prev_post:
<li class="previous">
<a href="${post.prev_post.permalink()}" rel="prev">← ${messages("Previous post")}</a>
</li>
%endif
%if post.next_post:
<li class="next">
<a href="${post.next_post.permalink()}" rel="next">${messages("Next post")} →</a>
</li>
%endif
</ul>
%endif
</%def>
<%def name="twitter_card_information(post)">
%if twitter_card and twitter_card['use_twitter_cards']:
<meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}">
<meta name="og:url" content="${post.permalink(absolute=True)}">
%if 'site:id' in twitter_card:
<meta name="twitter:site:id" content="${twitter_card['site:id']}">
%elif 'site' in twitter_card:
<meta name="twitter:site" content="${twitter_card['site']}">
%endif
%if 'creator:id' in twitter_card:
<meta name="twitter:creator:id" content="${twitter_card['creator:id']}">
%elif 'creator' in twitter_card:
<meta name="twitter:creator" content="${twitter_card['creator']}">
%endif
<meta name="og:title" content="${post.title()[:70]|h}">
%if post.description():
<meta name="og:description" content="${post.description()[:200]|h}">
%else:
<meta name="og:description" content="${post.text(strip_html=True)[:200]|h}">
%endif
%endif
</%def>
<%def name="mathjax_script(post)">
%if post.is_mathjax:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}
});
</script>
<script src="/assets/js/mathjax.js"></script>
%endif
</%def>
|