Skip to content

Commit 31cf1b3

Browse files
committedMay 25, 2015
redoing the theme with latest base
1 parent de47e82 commit 31cf1b3

30 files changed

+1061
-386
lines changed
 
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends index.jade
2+
3+
block extra_head
4+
!= extra_head()
5+
if len(translations) > 1 and generate_atom
6+
for language in translations
7+
link(rel="alternate", type="application/atom+xml", title="Atom for the #{archive_name} section (#{language})", href="#{_link("archive_atom", archive_name, language)}")
8+
elif generate_atom:
9+
link(rel="alternate", type="application/atom+xml", title="Atom for the #{archive_name} archive", href="#{_link("archive_atom", archive_name)}")

‎v7/base-jade/templates/base.jade

+26-39
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
!!! 5
2-
3-
- import "base_helper.jade" as helper with context
4-
5-
html(lang=lang)
6-
head
7-
!= helper.html_head()
8-
= extra_head_data
9-
10-
body
11-
h1(id="blog-title")
12-
a(href=abs_link('/'), title=blog_title, rel="home")
13-
= blog_title
14-
15-
block belowtitle
16-
if translations|length > 1
17-
small
18-
= messages("Also available in:") + "&nbsp"
19-
for langname in translations
20-
if langname != lang
21-
a(href=_link("index", None, langname), rel="alternate", hreflang=langname)
22-
= messages("LANGUAGE", langname)
23-
24-
block content
25-
// Nothing in this template, override
26-
27-
small
28-
!= content_footer
29-
30-
// Sidebar
31-
ul.unstyled
32-
if license
33-
li
34-
= license
35-
!= helper.html_navigation_links()
36-
if search_form
37-
!= search_form
38-
!= late_load_js
39-
!= social_buttons_code
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
<%namespace name="header" file="base_header.tmpl" import="*"/>
4+
<%namespace name="footer" file="base_footer.tmpl" import="*"/>
5+
<%namespace name="annotations" file="annotation_helper.tmpl"/>
6+
${set_locale(lang)}
7+
${base.html_headstart()}
8+
<%block name="extra_head">
9+
### Leave this block alone.
10+
</%block>
11+
${template_hooks['extra_head']()}
12+
</head>
13+
<body>
14+
<a href="#content" class="sr-only sr-only-focusable">${messages("Skip to main content")}</a>
15+
<div id="container">
16+
${header.html_header()}
17+
<main id="content" role="main">
18+
<%block name="content"></%block>
19+
</main>
20+
${footer.html_footer()}
21+
</div>
22+
${body_end}
23+
${template_hooks['body_end']()}
24+
${base.late_load_js()}
25+
</body>
26+
</html>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
4+
<%def name="html_footer()">
5+
%if content_footer:
6+
<footer id="footer" role="contentinfo">
7+
<p>${content_footer}</p>
8+
${template_hooks['page_footer']()}
9+
</footer>
10+
%endif
11+
</%def>
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="base" file="base_helper.tmpl" import="*"/>
3+
4+
<%def name="html_header()">
5+
<header id="header" role="banner">
6+
${html_site_title()}
7+
${html_translation_header()}
8+
${html_navigation_links()}
9+
%if search_form:
10+
<div class="searchform" role="search">
11+
${search_form}
12+
</div>
13+
%endif
14+
</header>
15+
${template_hooks['page_header']()}
16+
</%def>
17+
18+
<%def name="html_site_title()">
19+
<h1 id="brand"><a href="${abs_link(_link("root", None, lang))}" title="${blog_title}" rel="home">
20+
%if logo_url:
21+
<img src="${logo_url}" alt="${blog_title}" id="logo">
22+
%endif
23+
24+
% if show_blog_title:
25+
<span id="blog-title">${blog_title}</span>
26+
% endif
27+
</a></h1>
28+
</%def>
29+
30+
<%def name="html_navigation_links()">
31+
<nav id="menu" role="navigation">
32+
<ul>
33+
%for url, text in navigation_links[lang]:
34+
% if isinstance(url, tuple):
35+
<li> ${text}
36+
<ul>
37+
%for suburl, text in url:
38+
% if rel_link(permalink, suburl) == "#":
39+
<li class="active"><a href="${permalink}">${text}</a></li>
40+
%else:
41+
<li><a href="${suburl}">${text}</a></li>
42+
%endif
43+
%endfor
44+
</ul>
45+
% else:
46+
% if rel_link(permalink, url) == "#":
47+
<li class="active"><a href="${permalink}">${text}</a></li>
48+
%else:
49+
<li><a href="${url}">${text}</a></li>
50+
%endif
51+
% endif
52+
%endfor
53+
${template_hooks['menu']()}
54+
${template_hooks['menu_alt']()}
55+
</ul>
56+
</nav>
57+
</%def>
58+
59+
<%def name="html_translation_header()">
60+
%if len(translations) > 1:
61+
<div id="toptranslations">
62+
<h2>${messages("Languages:")}</h2>
63+
${base.html_translations()}
64+
</div>
65+
%endif
66+
</%def>
+115-61
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,115 @@
1-
mixin html_head()
2-
meta(charset='utf-8')
3-
if description:
4-
meta(name="description" content=description)
5-
meta(name="author" content=blog_author)
6-
// needs striphtml
7-
title(text=(title + ' | ' + blog_title))
8-
= mathjax_config
9-
if use_bundles
10-
if use_cdn
11-
link(href="/assets/css/all.css", rel="stylesheet", type="text/css")
12-
else
13-
link(href="/assets/css/all-nocdn.css", rel="stylesheet", type="text/css")
14-
else
15-
link(href="/assets/css/rst.css", rel="stylesheet", type="text/css")
16-
link(href="/assets/css/code.css", rel="stylesheet", type="text/css")
17-
link(href="/assets/css/theme.css", rel="stylesheet", type="text/css")
18-
if has_custom_css
19-
link(href="/assets/css/custom.css", rel="stylesheet", type="text/css")
20-
21-
if permalink
22-
link(rel="canonical", href=abs_link(permalink))
23-
24-
if rss_link
25-
= rss_link
26-
else
27-
if translations|length > 1
28-
for language in translations
29-
link(rel="alternate", type="application/rss+xml", title="RSS ("+language+")", href=_link('rss', None, language))
30-
else:
31-
link(rel="alternate", type="application/rss+xml", title="RSS", href=_link('rss', None))
32-
33-
if favicons
34-
for name, file, size in favicons
35-
link(rel=name, href=file, sizes=size)
36-
37-
mixin html_navigation_links()
38-
// Links seem broken somehow
39-
for url, text in navigation_links[lang]
40-
if url|istuple
41-
li
42-
= text
43-
ul
44-
for suburl, text in url
45-
if rel_link(permalink, url) == '#'
46-
li(class='active')
47-
a(href=permalink)
48-
= text
49-
else
50-
li
51-
a(href=permalink)
52-
= text
53-
else
54-
if rel_link(permalink, url) == '#'
55-
li(class='active')
56-
a(href=permalink)
57-
= text
58-
else
59-
li
60-
a(href=permalink)
61-
= text
1+
## -*- coding: utf-8 -*-
2+
3+
<%def name="html_headstart()">
4+
<!DOCTYPE html>
5+
<html \
6+
prefix='\
7+
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
8+
og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
9+
%endif
10+
%if comment_system == 'facebook':
11+
fb: http://ogp.me/ns/fb#
12+
%endif
13+
' \
14+
%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
15+
vocab="http://ogp.me/ns" \
16+
%endif
17+
% if is_rtl:
18+
dir="rtl" \
19+
% endif
20+
\
21+
lang="${lang}">
22+
<head>
23+
<meta charset="utf-8">
24+
%if description:
25+
<meta name="description" content="${description}">
26+
%endif
27+
<meta name="viewport" content="width=device-width">
28+
<title>${title|striphtml} | ${blog_title|striphtml}</title>
29+
30+
${html_stylesheets()}
31+
${html_feedlinks()}
32+
%if permalink:
33+
<link rel="canonical" href="${abs_link(permalink)}">
34+
%endif
35+
36+
%if favicons:
37+
%for name, file, size in favicons:
38+
<link rel="${name}" href="${file}" sizes="${size}"/>
39+
%endfor
40+
%endif
41+
42+
% if comment_system == 'facebook':
43+
<meta property="fb:app_id" content="${comment_system_id}">
44+
% endif
45+
46+
%if prevlink:
47+
<link rel="prev" href="${prevlink}" type="text/html">
48+
%endif
49+
%if nextlink:
50+
<link rel="next" href="${nextlink}" type="text/html">
51+
%endif
52+
53+
${mathjax_config}
54+
%if use_cdn:
55+
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
56+
%else:
57+
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
58+
%endif
59+
60+
${extra_head_data}
61+
</%def>
62+
63+
<%def name="late_load_js()">
64+
${social_buttons_code}
65+
</%def>
66+
67+
<%def name="html_stylesheets()">
68+
%if use_bundles:
69+
%if use_cdn:
70+
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
71+
%else:
72+
<link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
73+
%endif
74+
%else:
75+
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
76+
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
77+
<link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
78+
%if has_custom_css:
79+
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
80+
%endif
81+
%endif
82+
</%def>
83+
84+
<%def name="html_feedlinks()">
85+
%if rss_link:
86+
${rss_link}
87+
%elif generate_rss:
88+
%if len(translations) > 1:
89+
%for language in translations:
90+
<link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
91+
%endfor
92+
%else:
93+
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
94+
%endif
95+
%endif
96+
%if generate_atom:
97+
%if len(translations) > 1:
98+
%for language in translations:
99+
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
100+
%endfor
101+
%else:
102+
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
103+
%endif
104+
%endif
105+
</%def>
106+
107+
<%def name="html_translations()">
108+
<ul class="translations">
109+
%for langname in translations.keys():
110+
%if langname != lang:
111+
<li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
112+
%endif
113+
%endfor
114+
</ul>
115+
</%def>
+63-61
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,63 @@
1-
- import "disqus_helper.jade" as disqus with context
2-
//- namespace name="livefyre" file="livefyre_helper"
3-
//- namespace name="intensedebate" file="intensedebate_helper"
4-
//- namespace name="moot" file="moot_helper"
5-
//- namespace name="googleplus" file="googleplus_helper"
6-
//- namespace name="facebook" file="facebook_helper"
7-
//- namespace name="isso" file="isso_helper"
8-
9-
mixin comment_form(url, title, identifier)
10-
if comment_system == 'disqus'
11-
!= disqus.comment_form(url, title, identifier)
12-
elif comment_system == 'livefyre'
13-
!= livefyre.comment_form(url, title, identifier)
14-
elif comment_system == 'intensedebate'
15-
!= intensedebate.comment_form(url, title, identifier)
16-
elif comment_system == 'moot'
17-
!= moot.comment_form(url, title, identifier)
18-
elif comment_system == 'googleplus'
19-
!= googleplus.comment_form(url, title, identifier)
20-
elif comment_system == 'facebook'
21-
!= facebook.comment_form(url, title, identifier)
22-
elif comment_system == 'isso'
23-
!= isso.comment_form(url, title, identifier)
24-
25-
26-
27-
mixin comment_link(link, identifier)
28-
if comment_system == 'disqus'
29-
!= disqus.comment_link(link, identifier)
30-
elif comment_system == 'livefyre'
31-
!= livefyre.comment_link(link, identifier)
32-
elif comment_system == 'intensedebate'
33-
!= intensedebate.comment_link(link, identifier)
34-
elif comment_system == 'moot'
35-
!= moot.comment_link(link, identifier)
36-
elif comment_system == 'googleplus'
37-
!= googleplus.comment_link(link, identifier)
38-
elif comment_system == 'facebook'
39-
!= facebook.comment_link(link, identifier)
40-
elif comment_system == 'isso'
41-
!= isso.comment_link(link, identifier)
42-
43-
44-
45-
mixin comment_link_script()
46-
if comment_system == 'disqus'
47-
!= disqus.comment_link_script()
48-
elif comment_system == 'livefyre'
49-
!= livefyre.comment_link_script()
50-
elif comment_system == 'intensedebate'
51-
!= intensedebate.comment_link_script()
52-
elif comment_system == 'moot'
53-
!= moot.comment_link_script()
54-
elif comment_system == 'googleplus'
55-
!= googleplus.comment_link_script()
56-
elif comment_system == 'facebook'
57-
!= facebook.comment_link_script()
58-
elif comment_system == 'isso'
59-
!= isso.comment_link_script()
60-
61-
1+
## -*- coding: utf-8 -*-
2+
3+
<%namespace name="disqus" file="comments_helper_disqus.tmpl"/>
4+
<%namespace name="livefyre" file="comments_helper_livefyre.tmpl"/>
5+
<%namespace name="intensedebate" file="comments_helper_intensedebate.tmpl"/>
6+
<%namespace name="muut" file="comments_helper_muut.tmpl"/>
7+
<%namespace name="googleplus" file="comments_helper_googleplus.tmpl"/>
8+
<%namespace name="facebook" file="comments_helper_facebook.tmpl"/>
9+
<%namespace name="isso" file="comments_helper_isso.tmpl"/>
10+
11+
<%def name="comment_form(url, title, identifier)">
12+
%if comment_system == 'disqus':
13+
${disqus.comment_form(url, title, identifier)}
14+
% elif comment_system == 'livefyre':
15+
${livefyre.comment_form(url, title, identifier)}
16+
% elif comment_system == 'intensedebate':
17+
${intensedebate.comment_form(url, title, identifier)}
18+
% elif comment_system == 'muut':
19+
${muut.comment_form(url, title, identifier)}
20+
% elif comment_system == 'googleplus':
21+
${googleplus.comment_form(url, title, identifier)}
22+
% elif comment_system == 'facebook':
23+
${facebook.comment_form(url, title, identifier)}
24+
% elif comment_system == 'isso':
25+
${isso.comment_form(url, title, identifier)}
26+
%endif
27+
</%def>
28+
29+
<%def name="comment_link(link, identifier)">
30+
%if comment_system == 'disqus':
31+
${disqus.comment_link(link, identifier)}
32+
% elif comment_system == 'livefyre':
33+
${livefyre.comment_link(link, identifier)}
34+
% elif comment_system == 'intensedebate':
35+
${intensedebate.comment_link(link, identifier)}
36+
% elif comment_system == 'muut':
37+
${muut.comment_link(link, identifier)}
38+
% elif comment_system == 'googleplus':
39+
${googleplus.comment_link(link, identifier)}
40+
% elif comment_system == 'facebook':
41+
${facebook.comment_link(link, identifier)}
42+
% elif comment_system == 'isso':
43+
${isso.comment_link(link, identifier)}
44+
%endif
45+
</%def>
46+
47+
<%def name="comment_link_script()">
48+
%if comment_system == 'disqus':
49+
${disqus.comment_link_script()}
50+
% elif comment_system == 'livefyre':
51+
${livefyre.comment_link_script()}
52+
% elif comment_system == 'intensedebate':
53+
${intensedebate.comment_link_script()}
54+
% elif comment_system == 'muut':
55+
${muut.comment_link_script()}
56+
% elif comment_system == 'googleplus':
57+
${googleplus.comment_link_script()}
58+
% elif comment_system == 'facebook':
59+
${facebook.comment_link_script()}
60+
% elif comment_system == 'isso':
61+
${isso.comment_link_script()}
62+
%endif
63+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## -*- coding: utf-8 -*-
2+
3+
<%! import json %>
4+
5+
<%def name="comment_form(url, title, identifier)">
6+
%if comment_system_id:
7+
<div id="disqus_thread"></div>
8+
<script>
9+
var disqus_shortname ="${comment_system_id}",
10+
%if url:
11+
disqus_url="${url}",
12+
%endif
13+
disqus_title=${json.dumps(title)},
14+
disqus_identifier="${identifier}",
15+
disqus_config = function () {
16+
%if lang == 'es':
17+
this.language = "es_ES";
18+
%else:
19+
this.language = "${lang}";
20+
%endif
21+
};
22+
(function() {
23+
var dsq = document.createElement('script'); dsq.async = true;
24+
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
25+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
26+
})();
27+
</script>
28+
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
29+
<a href="//disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a>
30+
%endif
31+
</%def>
32+
33+
<%def name="comment_link(link, identifier)">
34+
%if comment_system_id:
35+
<a href="${link}#disqus_thread" data-disqus-identifier="${identifier}">Comments</a>
36+
%endif
37+
</%def>
38+
39+
40+
<%def name="comment_link_script()">
41+
%if comment_system_id:
42+
<script>var disqus_shortname="${comment_system_id}";(function(){var a=document.createElement("script");a.async=true;a.src="//"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}());</script>
43+
%endif
44+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## -*- coding: utf-8 -*-
2+
<%def name="comment_form(url, title, identifier)">
3+
<div id="fb-root"></div>
4+
<script>
5+
window.fbAsyncInit = function() {
6+
// init the FB JS SDK
7+
FB.init({
8+
appId : '${comment_system_id}',
9+
status : true,
10+
xfbml : true
11+
});
12+
13+
};
14+
15+
// Load the SDK asynchronously
16+
(function(d, s, id){
17+
var js, fjs = d.getElementsByTagName(s)[0];
18+
if (d.getElementById(id)) {return;}
19+
js = d.createElement(s); js.id = id;
20+
js.src = "//connect.facebook.net/en_US/all.js";
21+
fjs.parentNode.insertBefore(js, fjs);
22+
}(document, 'script', 'facebook-jssdk'));
23+
</script>
24+
25+
<div class="fb-comments" data-href="${url}" data-width="470"></div>
26+
</%def>
27+
28+
<%def name="comment_link(link, identifier)">
29+
<span class="fb-comments-count" data-url="${link}">
30+
</%def>
31+
32+
<%def name="comment_link_script()">
33+
<div id="fb-root"></div>
34+
<script>
35+
// thank lxml for this
36+
$('.fb-comments-count').each(function(i, obj) {
37+
var url = obj.attributes['data-url'].value;
38+
// change here if you dislike the default way of displaying
39+
// this
40+
obj.innerHTML = '<fb:comments-count href="' + url + '"></fb:comments-count> comments';
41+
});
42+
43+
window.fbAsyncInit = function() {
44+
// init the FB JS SDK
45+
FB.init({
46+
appId : '${comment_system_id}',
47+
status : true,
48+
xfbml : true
49+
});
50+
51+
};
52+
53+
// Load the SDK asynchronously
54+
(function(d, s, id){
55+
var js, fjs = d.getElementsByTagName(s)[0];
56+
if (d.getElementById(id)) {return;}
57+
js = d.createElement(s); js.id = id;
58+
js.src = "//connect.facebook.net/en_US/all.js";
59+
fjs.parentNode.insertBefore(js, fjs);
60+
}(document, 'script', 'facebook-jssdk'));
61+
</script>
62+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## -*- coding: utf-8 -*-
2+
<%def name="comment_form(url, title, identifier)">
3+
<script src="https://apis.google.com/js/plusone.js"></script>
4+
<div class="g-comments"
5+
data-href="${url}"
6+
data-first_party_property="BLOGGER"
7+
data-view_type="FILTERED_POSTMOD">
8+
</div>
9+
</%def>
10+
11+
<%def name="comment_link(link, identifier)">
12+
<div class="g-commentcount" data-href="${link}"></div>
13+
<script src="https://apis.google.com/js/plusone.js"></script>
14+
</%def>
15+
16+
<%def name="comment_link_script()">
17+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## -*- coding: utf-8 -*-
2+
<%def name="comment_form(url, title, identifier)">
3+
<script>
4+
var idcomments_acct = '${comment_system_id}';
5+
var idcomments_post_id = "${identifier}";
6+
var idcomments_post_url = "${url}";
7+
</script>
8+
<span id="IDCommentsPostTitle" style="display:none"></span>
9+
<script src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
10+
</script>
11+
</%def>
12+
13+
<%def name="comment_link(link, identifier)">
14+
<a href="{link}" onclick="this.href='${link}'; this.target='_self';"><span class='IDCommentsReplace' style='display:none'>${identifier}</span>
15+
<script>
16+
var idcomments_acct = '${comment_system_id}';
17+
var idcomments_post_id = "${identifier}";
18+
var idcomments_post_url = "${link}";
19+
</script>
20+
<script src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script>
21+
</a>
22+
</%def>
23+
24+
<%def name="comment_link_script()">
25+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## -*- coding: utf-8 -*-
2+
<%def name="comment_form(url, title, identifier)">
3+
%if comment_system_id:
4+
<div data-title="${title|u}" id="isso-thread"></div>
5+
<script src="${comment_system_id}js/embed.min.js" data-isso="${comment_system_id}"></script>
6+
%endif
7+
</%def>
8+
9+
<%def name="comment_link(link, identifier)">
10+
%if comment_system_id:
11+
<a href="${link}#isso-thread">Comments</a>
12+
%endif
13+
</%def>
14+
15+
16+
<%def name="comment_link_script()">
17+
%if comment_system_id:
18+
<script src="${comment_system_id}js/count.min.js" data-isso="${comment_system_id}"></script>
19+
%endif
20+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## -*- coding: utf-8 -*-
2+
<%def name="comment_form(url, title, identifier)">
3+
<div id="livefyre-comments"></div>
4+
<script src="http://zor.livefyre.com/wjs/v3.0/javascripts/livefyre.js"></script>
5+
<script>
6+
(function () {
7+
var articleId = "${identifier}";
8+
fyre.conv.load({}, [{
9+
el: 'livefyre-comments',
10+
network: "livefyre.com",
11+
siteId: "${comment_system_id}",
12+
articleId: articleId,
13+
signed: false,
14+
collectionMeta: {
15+
articleId: articleId,
16+
url: fyre.conv.load.makeCollectionUrl(),
17+
}
18+
}], function() {});
19+
}());
20+
</script>
21+
</%def>
22+
23+
<%def name="comment_link(link, identifier)">
24+
<a href="${link}">
25+
<span class="livefyre-commentcount" data-lf-site-id="${comment_system_id}" data-lf-article-id="${identifier}">
26+
0 Comments
27+
</span>
28+
</%def>
29+
30+
31+
<%def name="comment_link_script()">
32+
<script src="http://zor.livefyre.com/wjs/v1.0/javascripts/CommentCount.js"></script>
33+
</%def>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="comments" file="comments_helper.tmpl"/>
3+
% if not post.meta('nocomments'):
4+
${comments.comment_form(post.permalink(absolute=True), post.title(), post.base_path)}
5+
% endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## -*- coding: utf-8 -*-
2+
3+
<%def name="comment_form(url, title, identifier)">
4+
<a class="muut" href="https://muut.com/i/${comment_system_id}/${identifier}">${comment_system_id} forums</a>
5+
</%def>
6+
7+
<%def name="comment_link(link, identifier)">
8+
</%def>
9+
10+
11+
<%def name="comment_link_script()">
12+
<script src="//cdn.muut.com/1/moot.min.js"></script>
13+
</%def>

‎v7/base-jade/templates/crumbs.jade

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
mixin bar(crumbs)
2-
if crumbs
3-
nav(class='breadcrumbs')
4-
ul(class='breadcrumb')
5-
for link, text in crumbs
6-
if text != index_file
7-
if link == '#'
8-
li
9-
= text
10-
else
11-
li
12-
a(href=link)
13-
= text
1+
## -*- coding: utf-8 -*-
2+
3+
<%def name="bar(crumbs)">
4+
%if crumbs:
5+
<nav class="breadcrumbs">
6+
<ul class="breadcrumb">
7+
% for link, text in crumbs:
8+
% if text != index_file:
9+
% if link == '#':
10+
<li>${text}</li>
11+
% else:
12+
<li><a href="${link}">${text}</a></li>
13+
% endif
14+
% endif
15+
% endfor
16+
</ul>
17+
</nav>
18+
%endif
19+
</%def>

‎v7/base-jade/templates/gallery.jade

+41-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.tmpl"/>
3+
<%namespace name="comments" file="comments_helper.tmpl"/>
4+
<%namespace name="ui" file="crumbs.tmpl" import="bar"/>
5+
<%block name="sourcelink"></%block>
6+
7+
<%block name="content">
8+
${ui.bar(crumbs)}
9+
%if title:
10+
<h1>${title|h}</h1>
11+
%endif
12+
%if post:
13+
<p>
14+
${post.text()}
15+
</p>
16+
%endif
17+
%if folders:
18+
<ul>
19+
% for folder, ftitle in folders:
20+
<li><a href="${folder}"><i
21+
class="icon-folder-open"></i>&nbsp;${ftitle}</a></li>
22+
% endfor
23+
</ul>
24+
%endif
25+
%if photo_array:
26+
<ul class="thumbnails">
27+
%for image in photo_array:
28+
<li><a href="${image['url']}" class="thumbnail image-reference" title="${image['title']}">
29+
<img src="${image['url_thumb']}" alt="${image['title']}" /></a>
30+
%endfor
31+
</ul>
32+
%endif
33+
%if site_has_comments and enable_comments:
34+
${comments.comment_form(None, permalink, title)}
35+
%endif
36+
</%block>
37+
38+
<%block name="extra_head">
39+
${parent.extra_head()}
40+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
41+
</%block>

‎v7/base-jade/templates/index.jade

+40-38
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="index_helper.tmpl"/>
3+
<%namespace name="comments" file="comments_helper.tmpl"/>
4+
<%inherit file="base.tmpl"/>
25

3-
block content
4-
for post in posts
5-
article(class="postbox h-entry post-"+post.meta("type"))
6-
h1(class="p-name")
7-
a(href=post.permalink(), class="u-url")
8-
= post.title()
9-
small
10-
!= "&nbsp;&nbsp;"+messages("Posted:")
11-
time(class="published dt-published, datetime=post.date.isoformat())
12-
= post.formatted_date(date_format)
13-
if index_teasers
14-
div(class="p-summary")
15-
!= post.text(teaser_only=True)
16-
else
17-
div(class="e-content")
18-
!= post.text(teaser_only=False)
6+
<%block name="extra_head">
7+
${parent.extra_head()}
8+
% if posts and (permalink == '/' or permalink == '/' + index_file):
9+
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
10+
% endif
11+
</%block>
1912

20-
if prevlink or nextlink
21-
div.ul(class="pager")
22-
if prevlink
23-
li(class="previous")
24-
a(href=prevlink, rel="prev")
25-
!= "&larr;" + messages("Newer posts")
26-
if nextlink
27-
li(class="next")
28-
a(href=nextlink, rel="next")
29-
!= "&rarr;" + messages("Older posts")
30-
31-
// FIXME: add comment_link
32-
33-
// FIXME: this repeats because break doesn't work?
34-
each post in posts
35-
if post.is_mathjax
36-
script(type="text/x-mathjax-config")
37-
| MathJax.Hub.Config({
38-
| tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}
39-
| });
40-
script(src="/assets/js/mathjax.js")
13+
<%block name="content">
14+
<%block name="content_header"></%block>
15+
<div class="postindex">
16+
% for post in posts:
17+
<article class="h-entry post-${post.meta('type')}">
18+
<header>
19+
<h1 class="p-name entry-title"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
20+
<div class="metadata">
21+
<p class="byline author vcard"><span class="byline-name fn">${post.author()}</span></p>
22+
<p class="dateline"><a href="${post.permalink()}" rel="bookmark"><time class="published dt-published" datetime="${post.date.isoformat()}" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></a></p>
23+
% if not post.meta('nocomments') and site_has_comments:
24+
<p class="commentline">${comments.comment_link(post.permalink(), post._base_path)}
25+
% endif
26+
</div>
27+
</header>
28+
%if index_teasers:
29+
<div class="p-summary entry-summary">
30+
${post.text(teaser_only=True)}
31+
%else:
32+
<div class="e-content entry-content">
33+
${post.text(teaser_only=False)}
34+
%endif
35+
</div>
36+
</article>
37+
% endfor
38+
</div>
39+
${helper.html_pager()}
40+
${comments.comment_link_script()}
41+
${helper.mathjax_script(posts)}
42+
</%block>
+26-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
!!! 5
2-
include base_helper.jade
3-
html(lang=lang)
4-
head
5-
+base_head()
6-
title= pageTitle
1+
## -*- coding: utf-8 -*-
2+
<%def name="html_pager()">
3+
%if prevlink or nextlink:
4+
<nav class="postindexpager">
5+
<ul class="pager">
6+
%if prevlink:
7+
<li class="previous">
8+
<a href="${prevlink}" rel="prev">${messages("Newer posts")}</a>
9+
</li>
10+
%endif
11+
%if nextlink:
12+
<li class="next">
13+
<a href="${nextlink}" rel="next">${messages("Older posts")}</a>
14+
</li>
15+
%endif
16+
</ul>
17+
</nav>
18+
%endif
19+
</%def>
720

8-
body
9-
h1.title Jade - node template engine
10-
#container
11-
if youAreUsingJade
12-
p You are amazing
13-
else
14-
p Get on it!
21+
<%def name="mathjax_script(posts)">
22+
%if any(post.is_mathjax for post in posts):
23+
<script type="text/x-mathjax-config">
24+
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});</script>
25+
<script src="/assets/js/mathjax.js"></script>
26+
%endif
27+
</%def>

‎v7/base-jade/templates/list.jade

+19-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.tmpl"/>
3+
4+
<%block name="content">
5+
<article class="listpage">
6+
<header>
7+
<h1>${title}</h1>
8+
</header>
9+
%if items:
10+
<ul class="postlist">
11+
% for text, link in items:
12+
<li><a href="${link}">${text}</a>
13+
% endfor
14+
</ul>
15+
%else:
16+
<p>${messages("Nothing found.")}</p>
17+
%endif
18+
</article>
19+
</%block>

‎v7/base-jade/templates/list_post.jade

+19-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.tmpl"/>
3+
4+
<%block name="content">
5+
<article class="listpage">
6+
<header>
7+
<h1>${title}</h1>
8+
</header>
9+
%if posts:
10+
<ul class="postlist">
11+
% for post in posts:
12+
<li><a href="${post.permalink()}" class="listtitle">${post.title()|h}</a> <time class="listdate" datetime="${post.date.isoformat()}" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></li>
13+
% endfor
14+
</ul>
15+
%else:
16+
<p>${messages("No posts found.")}</p>
17+
%endif
18+
</article>
19+
</%block>

‎v7/base-jade/templates/listing.jade

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
extends base
2-
- import 'crumbs.jade' as crumbbar
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.tmpl"/>
3+
<%namespace name="ui" file="crumbs.tmpl" import="bar"/>
4+
<%block name="content">
5+
${ui.bar(crumbs)}
6+
%if folders or files:
7+
<ul>
8+
% for name in folders:
9+
<li><a href="${name}"><i class="icon-folder-open"></i> ${name}</a>
10+
% endfor
11+
% for name in files:
12+
<li><a href="${name}.html"><i class="icon-file"></i> ${name}</a>
13+
% endfor
14+
</ul>
15+
%endif
16+
% if code:
17+
${code}
18+
% endif
19+
% if source_link:
20+
<p class="sourceline"><a href="${source_link}" id="sourcelink">${messages("Source")}</a></p>
21+
% endif
22+
</%block>
323

4-
block content
5-
!= crumbbar.bar(crumbs)
6-
if folders or files
7-
ul(class="unstyled")
8-
for name in folders
9-
li.a(href=name)
10-
i(class="icon-folder-open")
11-
= name
12-
for name in files
13-
li.a(href=name)
14-
i(class="icon-file")
15-
= name
16-
if code
17-
!= code

‎v7/base-jade/templates/post.jade

+49-36
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="pheader" file="post_header.tmpl"/>
4+
<%namespace name="comments" file="comments_helper.tmpl"/>
5+
<%inherit file="base.tmpl"/>
26

3-
- import "post_helper.jade" as post_helper with context
4-
- import "comments_helper.jade" as comments with context
7+
<%block name="extra_head">
8+
${parent.extra_head()}
9+
% if post.meta('keywords'):
10+
<meta name="keywords" content="${post.meta('keywords')|h}">
11+
% endif
12+
%if post.description():
13+
<meta name="description" content="${post.description()}">
14+
%endif
15+
<meta name="author" content="${post.author()}">
16+
%if post.prev_post:
17+
<link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()|h}" type="text/html">
18+
%endif
19+
%if post.next_post:
20+
<link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()|h}" type="text/html">
21+
%endif
22+
% if post.is_draft:
23+
<meta name="robots" content="noindex">
24+
% endif
25+
${helper.open_graph_metadata(post)}
26+
${helper.twitter_card_information(post)}
27+
${helper.meta_translations(post)}
28+
</%block>
529

6-
block extra_head
7-
!= post_helper.twitter_card_information(post)
8-
if post.meta('keywords')
9-
meta(name="keywords", content=post.meta(keywords))
10-
!= post_helper.meta_translations(post)
11-
12-
block content
13-
article(class="postbox post-"+post.meta('type'))
14-
div(class="h-entry", itemscope="itemscope", itemtype="http://schema.org/Article")
15-
!= post_helper.html_title(title)
16-
hr
17-
small
18-
= messages("Posted:")
19-
time(class="published dt-published", datetime=post.date.isoformat(), itemprop="datePublished")
20-
= post.formatted_date(date_format)
21-
!= post_helper.html_translations(post)
22-
!= post_helper.html_tags(post)
23-
24-
block sourcelink
25-
if not post.meta('password')
26-
a(href=post.source_link(), id="sourcelink")
27-
= messages("Source")
28-
hr
29-
div(class="e-content", itemprop="articleBody text")
30-
!= post.text()
31-
32-
if post.description():
33-
meta(content=post.description(), itemprop="description")
34-
35-
!= post_helper.html_pager(post)
36-
if not post.meta('nocomments')
37-
!= comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)
38-
!= post_helper.mathjax_script(post)
30+
<%block name="content">
31+
<article class="post-${post.meta('type')} h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article">
32+
${pheader.html_post_header()}
33+
<div class="e-content entry-content" itemprop="articleBody text">
34+
${post.text()}
35+
</div>
36+
<aside class="postpromonav">
37+
<nav>
38+
${helper.html_tags(post)}
39+
${helper.html_pager(post)}
40+
</nav>
41+
</aside>
42+
% if not post.meta('nocomments') and site_has_comments:
43+
<section class="comments">
44+
<h2>${messages("Comments")}</h2>
45+
${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)}
46+
</section>
47+
% endif
48+
${helper.mathjax_script(post)}
49+
</article>
50+
${comments.comment_link_script()}
51+
</%block>
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="comments" file="comments_helper.tmpl"/>
4+
5+
<%def name="html_title()">
6+
%if title and not post.meta('hidetitle'):
7+
<h1 class="p-name entry-title" itemprop="headline name"><a href="${post.permalink()}" class="u-url">${post.title()|h}</a></h1>
8+
%endif
9+
</%def>
10+
11+
<%def name="html_translations(post)">
12+
% if len(post.translated_to) > 1:
13+
<div class="metadata posttranslations translations">
14+
<h3 class="posttranslations-intro">${messages("Also available in:")}</h3>
15+
% for langname in translations.keys():
16+
% if langname != lang and post.is_translation_available(langname):
17+
<p><a href="${post.permalink(langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></p>
18+
% endif
19+
% endfor
20+
</div>
21+
% endif
22+
</%def>
23+
24+
<%def name="html_sourcelink()">
25+
% if show_sourcelink:
26+
<p class="sourceline"><a href="${post.source_link()}" id="sourcelink">${messages("Source")}</a></p>
27+
% endif
28+
</%def>
29+
30+
<%def name="html_post_header()">
31+
<header>
32+
${html_title()}
33+
<div class="metadata">
34+
<p class="byline author vcard"><span class="byline-name fn">${post.author()}</span></p>
35+
<p class="dateline"><a href="${post.permalink()}" rel="bookmark"><time class="published dt-published" datetime="${post.date.isoformat()}" itemprop="datePublished" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></a></p>
36+
% if not post.meta('nocomments') and site_has_comments:
37+
<p class="commentline">${comments.comment_link(post.permalink(), post._base_path)}
38+
% endif
39+
${html_sourcelink()}
40+
% if post.meta('link'):
41+
<p><a href='${post.meta('link')}'>${messages("Original site")}</a></p>
42+
% endif
43+
%if post.description():
44+
<meta name="description" itemprop="description" content="${post.description()}">
45+
%endif
46+
</div>
47+
${html_translations(post)}
48+
</header>
49+
</%def>
+87-65
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,93 @@
1-
mixin html_title(title)
2-
h1(class="p-name",itemprop="headline name")
3-
= title
4-
if link
5-
p
6-
a(href=link)
7-
i= messages("Original site")
1+
## -*- coding: utf-8 -*-
82

9-
mixin meta_translations(post)
10-
if translations|length > 1
11-
for langname in translations.keys()
12-
if langname != lang and post.is_translation_available(langname)
13-
link(rel="alternate", hreflang=langname, href=post.permalink(langname))
3+
<%def name="meta_translations(post)">
4+
%if len(translations) > 1:
5+
%for langname in translations.keys():
6+
%if langname != lang and post.is_translation_available(langname):
7+
<link rel="alternate" hreflang="${langname}" href="${post.permalink(langname)}">
8+
%endif
9+
%endfor
10+
%endif
11+
</%def>
1412

15-
mixin html_translations(post)
16-
if translations|length > 1
17-
for langname in translation.keys()
18-
if langname != lang and post.is_translation_available(langname)
19-
&nbsp;&nbsp;|&nbsp;&nbsp;
20-
a(href=post.permalink(langname), rel="alternate", hreflang=langname)
21-
= messages("Read in English", langname)
13+
<%def name="html_tags(post)">
14+
%if post.tags:
15+
<ul itemprop="keywords" class="tags">
16+
%for tag in post.tags:
17+
% if tag not in hidden_tags:
18+
<li><a class="tag p-category" href="${_link('tag', tag)}" rel="tag">${tag}</a></li>
19+
% endif
20+
%endfor
21+
</ul>
22+
%endif
23+
</%def>
2224

23-
mixin html_list_tags(post)
24-
span(itemprop="keywords")
25-
for tag in post.tags
26-
&nbsp;
27-
a(class="tag p-category", href=_link('tag', tag))
28-
span(class="badge badge-info")
29-
= tag
25+
<%def name="html_pager(post)">
26+
%if post.prev_post or post.next_post:
27+
<ul class="pager">
28+
%if post.prev_post:
29+
<li class="previous">
30+
<a href="${post.prev_post.permalink()}" rel="prev" title="${post.prev_post.title()|h}">${messages("Previous post")}</a>
31+
</li>
32+
%endif
33+
%if post.next_post:
34+
<li class="next">
35+
<a href="${post.next_post.permalink()}" rel="next" title="${post.next_post.title()|h}">${messages("Next post")}</a>
36+
</li>
37+
%endif
38+
</ul>
39+
%endif
40+
</%def>
3041

31-
mixin html_tags(post)
32-
if post.tags
33-
&nbsp;&nbsp;|&nbsp;&nbsp;
34-
!= formatmsg(messages("More posts about %s"), html_list_tags(post))
42+
<%def name="open_graph_metadata(post)">
43+
%if use_open_graph:
44+
<meta property="og:site_name" content="${blog_title|striphtml}">
45+
<meta property="og:title" content="${post.title()[:70]|h}">
46+
<meta property="og:url" content="${abs_link(permalink)}">
47+
%if post.description():
48+
<meta property="og:description" content="${post.description()[:200]|h}">
49+
%else:
50+
<meta property="og:description" content="${post.text(strip_html=True)[:200]|h}">
51+
%endif
52+
%if post.previewimage:
53+
<meta property="og:image" content="${url_replacer(permalink, post.previewimage, lang, 'absolute')}">
54+
%endif
55+
<meta property="og:type" content="article">
56+
### Will only work with Pintrest and breaks everywhere else who expect a [Facebook] URI.
57+
### %if post.author():
58+
### <meta property="article:author" content="${post.author()}">
59+
### %endif
60+
%if post.date.isoformat():
61+
<meta property="article:published_time" content="${post.date.isoformat()}">
62+
%endif
63+
%if post.tags:
64+
%for tag in post.tags:
65+
<meta property="article:tag" content="${tag}">
66+
%endfor
67+
%endif
68+
%endif
69+
</%def>
3570

36-
mixin html_pager(post)
37-
if post.prev_post or post.next_post
38-
ul(class="pager")
39-
if post.prev_post
40-
li(class="previous")
41-
a(href=post.prev_post.permalink(), rel="prev")
42-
&larr;
43-
= messages("Previous post")
44-
if post.next_post:
45-
li(class="next")
46-
a(href=post.next_post.permalink(), rel="next")
47-
= messages("Next post")
48-
&rarr
71+
<%def name="twitter_card_information(post)">
72+
%if twitter_card and twitter_card['use_twitter_cards']:
73+
<meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}">
74+
%if 'site:id' in twitter_card:
75+
<meta name="twitter:site:id" content="${twitter_card['site:id']}">
76+
%elif 'site' in twitter_card:
77+
<meta name="twitter:site" content="${twitter_card['site']}">
78+
%endif
79+
%if 'creator:id' in twitter_card:
80+
<meta name="twitter:creator:id" content="${twitter_card['creator:id']}">
81+
%elif 'creator' in twitter_card:
82+
<meta name="twitter:creator" content="${twitter_card['creator']}">
83+
%endif
84+
%endif
85+
</%def>
4986

50-
mixin mathjax_script(post)
51-
if post.is_mathjax
52-
script(type="text/x-mathjax-config") MathJax.Hub.Config({ tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]} });
53-
script(src="/assets/js/mathjax.js")
54-
55-
mixin twitter_card_information(post)
56-
if twitter_card and twitter_card['use_twitter_cards']
57-
meta(name="twitter:card", content=twitter_card.get('card', 'summary'))
58-
meta(name="og:url", content=post.permalink(absolute=True))
59-
if 'site:id' in twitter_card
60-
meta(name="twitter:site:id", content=twitter_card['site:id'])
61-
elif 'site' in twitter_card
62-
meta(name="twitter:site", content=twitter_card['site'])
63-
if 'creator:id' in twitter_card
64-
meta(name="twitter:creator:id", content=twitter_card['creator:id'])
65-
elif 'creator' in twitter_card
66-
meta(name="twitter:creator", content=twitter_card['creator'])
67-
meta(name="og:title", content=post.title()[:70])
68-
if post.description()
69-
meta(name="og:description", content=post.description()[:200])
70-
else
71-
meta(name="og:description", content=post.text(strip_html=True)[:200])
87+
<%def name="mathjax_script(post)">
88+
%if post.is_mathjax:
89+
<script type="text/x-mathjax-config">
90+
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});</script>
91+
<script src="/assets/js/mathjax.js"></script>
92+
%endif
93+
</%def>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
!!! 5
2-
include base_helper.jade
3-
html(lang=lang)
4-
head
5-
+base_head()
6-
title= pageTitle
7-
8-
body
9-
h1.title Jade - node template engine
10-
#container
11-
if youAreUsingJade
12-
p You are amazing
13-
else
14-
p Get on it!
1+
## -*- coding: utf-8 -*-
2+
<%block name="content">
3+
<!-- Begin post-list ${post_list_id} -->
4+
<div id="${post_list_id}" class="post-list">
5+
%if posts:
6+
<ul class="post-list">
7+
% for post in posts:
8+
<li class="post-list-item">
9+
${post.formatted_date(date_format)}
10+
&nbsp;
11+
<a href="${post.permalink(lang)}">${post.title(lang)|h}</a>
12+
</li>
13+
% endfor
14+
</ul>
15+
%endif
16+
</div>
17+
<!-- End post-list ${post_list_id} -->
18+
</%block>

‎v7/base-jade/templates/slides.jade

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<%block name="content">
2+
<div id="${carousel_id}" class="carousel slide">
3+
<ol class="carousel-indicators">
4+
% for i in range(len(slides_content)):
5+
% if i == 0:
6+
<li data-target="#${carousel_id}" data-slide-to="${i}" class="active"></li>
7+
% else:
8+
<li data-target="#${carousel_id}" data-slide-to="${i}"></li>
9+
% endif
10+
% endfor
11+
</ol>
12+
<div class="carousel-inner">
13+
% for i, image in enumerate(slides_content):
14+
% if i == 0:
15+
<div class="item active"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div>
16+
% else:
17+
<div class="item"><img src="${image}" alt="" style="margin: 0 auto 0 auto;"></div>
18+
% endif
19+
% endfor
20+
</div>
21+
<a class="left carousel-control" href="#${carousel_id}" data-slide="prev">&lsaquo;</a>
22+
<a class="right carousel-control" href="#${carousel_id}" data-slide="next">&rsaquo;</a>
23+
</div>
24+
</%block>

‎v7/base-jade/templates/story.jade

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
extends post.jade
1+
## -*- coding: utf-8 -*-
2+
<%namespace name="helper" file="post_helper.tmpl"/>
3+
<%namespace name="pheader" file="post_header.tmpl"/>
4+
<%namespace name="comments" file="comments_helper.tmpl"/>
5+
<%inherit file="post.tmpl"/>
26

3-
block extra_head
4-
// FIXME add twitter card
5-
6-
block content
7-
if title and not post.meta('hidetitle')
8-
h1
9-
= title
10-
!= post.text()
11-
12-
if enable_comments and not post.meta('nocomments')
13-
// FIXME comment_form
7+
<%block name="content">
8+
<article class="storypage" itemscope="itemscope" itemtype="http://schema.org/Article">
9+
<header>
10+
${pheader.html_title()}
11+
${pheader.html_translations(post)}
12+
</header>
13+
<div class="e-content entry-content" itemprop="articleBody text">
14+
${post.text()}
15+
</div>
16+
%if site_has_comments and enable_comments and not post.meta('nocomments'):
17+
<section class="comments">
18+
<h2>${messages("Comments")}</h2>
19+
${comments.comment_form(post.permalink(absolute=True), post.title(), post.base_path)}
20+
</section>
21+
%endif
22+
${helper.mathjax_script(post)}
23+
</article>
24+
</%block>

‎v7/base-jade/templates/tag.jade

+51-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="list_post.tmpl"/>
3+
4+
<%block name="extra_head">
5+
${parent.extra_head()}
6+
%if len(translations) > 1 and generate_rss:
7+
%for language in translations:
8+
<link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for ${kind} ${tag} (${language})" href="${_link(kind + "_rss", tag, language)}">
9+
%endfor
10+
%elif generate_rss:
11+
<link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for ${kind} ${tag}" href="${_link(kind + "_rss", tag)}">
12+
%endif
13+
</%block>
14+
15+
16+
<%block name="content">
17+
<article class="tagpage">
18+
<header>
19+
<h1>${title|h}</h1>
20+
%if description:
21+
<p>${description}</p>
22+
%endif
23+
%if subcategories:
24+
${messages('Subcategories:')}
25+
<ul>
26+
%for name, link in subcategories:
27+
<li><a href="${link}">${name}</a></li>
28+
%endfor
29+
</ul>
30+
%endif
31+
<div class="metadata">
32+
%if len(translations) > 1 and generate_rss:
33+
%for language in translations:
34+
<p class="feedlink">
35+
<a href="${_link(kind + "_rss", tag, language)}" hreflang="${language}" type="application/rss+xml">${messages('RSS feed', language)} (${language})</a>&nbsp;
36+
</p>
37+
%endfor
38+
%elif generate_rss:
39+
<p class="feedlink"><a href="${_link(kind + "_rss", tag)}" type="application/rss+xml">${messages('RSS feed')}</a></p>
40+
%endif
41+
</div>
42+
</header>
43+
%if posts:
44+
<ul class="postlist">
45+
% for post in posts:
46+
<li><a href="${post.permalink()}" class="listtitle">${post.title()|h}</a> <time class="listdate" datetime="${post.date.isoformat()}" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></li>
47+
% endfor
48+
</ul>
49+
%endif
50+
</article>
51+
</%block>

‎v7/base-jade/templates/tagindex.jade

+23-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
!!! 5
2-
include base_helper.jade
3-
html(lang=lang)
4-
head
5-
+base_head()
6-
title= pageTitle
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="index.tmpl"/>
73

8-
body
9-
h1.title Jade - node template engine
10-
#container
11-
if youAreUsingJade
12-
p You are amazing
13-
else
14-
p Get on it!
4+
<%block name="content_header">
5+
%if subcategories:
6+
${messages('Subcategories:')}
7+
<ul>
8+
%for name, link in subcategories:
9+
<li><a href="${link}">${name}</a></li>
10+
%endfor
11+
</ul>
12+
%endif
13+
</%block>
14+
15+
<%block name="extra_head">
16+
${parent.extra_head()}
17+
%if len(translations) > 1 and generate_atom:
18+
%for language in translations:
19+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section (${language})" href="${_link(kind + "_atom", tag, language)}">
20+
%endfor
21+
%elif generate_atom:
22+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section" href="${_link("tag" + "_atom", tag)}">
23+
%endif
24+
</%block>

‎v7/base-jade/templates/tags.jade

+42-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
extends base.jade
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.tmpl"/>
3+
4+
<%block name="content">
5+
<article class="tagindex">
6+
<header>
7+
<h1>${title}</h1>
8+
</header>
9+
% if cat_items:
10+
% if items:
11+
<h2>${messages("Categories")}</h2>
12+
% endif
13+
% for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy:
14+
% for i in range(indent_change_before):
15+
<ul class="postlist">
16+
% endfor
17+
<li><a class="reference" href="${link}">${text}</a>
18+
% if indent_change_after <= 0:
19+
</li>
20+
% endif
21+
% for i in range(-indent_change_after):
22+
</ul>
23+
% if i + 1 < len(indent_levels):
24+
</li>
25+
% endif
26+
% endfor
27+
% endfor
28+
% if items:
29+
<h2>${messages("Tags")}</h2>
30+
% endif
31+
%endif
32+
% if items:
33+
<ul class="postlist">
34+
% for text, link in items:
35+
% if text not in hidden_tags:
36+
<li><a class="reference listtitle" href="${link}">${text}</a></li>
37+
% endif
38+
% endfor
39+
</ul>
40+
% endif
41+
</article>
42+
</%block>

0 commit comments

Comments
 (0)
Please sign in to comment.