Skip to content

Commit 7122250

Browse files
committedSep 12, 2015
Jinjify
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 666459e commit 7122250

26 files changed

+92
-80
lines changed
 

‎nikola/data/themes/base-jinja/templates/author.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
{{ super() }}
66
{% if translations|length > 1 and generate_rss %}
77
{% for language in translations|sort %}
8-
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author }} ({{ language }})" href="{{ _link(kind + "_rss", author, language) }}">
8+
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author|e }} ({{ language }})" href="{{ _link(kind + "_rss", author, language) }}">
99
{% endfor %}
1010
{% elif generate_rss %}
11-
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author }}" href="{{ _link(kind + "_rss", author) }}">
11+
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author|e }}" href="{{ _link(kind + "_rss", author) }}">
1212
{% endif %}
1313
{% endblock %}
1414

@@ -18,7 +18,7 @@
1818
<header>
1919
<h1>{{ title|e }}</h1>
2020
{% if description %}
21-
<p>{{ description }}</p>
21+
<p>{{ description|e }}</p>
2222
{% endif %}
2323
<div class="metadata">
2424
{% if translations|length > 1 and generate_rss %}
@@ -35,7 +35,7 @@
3535
{% if posts %}
3636
<ul class="postlist">
3737
{% for post in posts %}
38-
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format) }}">{{ post.formatted_date(date_format) }}</time></li>
38+
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></li>
3939
{% endfor %}
4040
</ul>
4141
{% endif %}

‎nikola/data/themes/base-jinja/templates/authorindex.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
{{ super() }}
66
{% if tranlations|length > 1 and generate_atom %}
77
{% for language in translations|sort %}
8-
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author }} section ({{ language }})" href="{{ _link(kind + "_atom", author, language) }}">
8+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author|e }} section ({{ language }})" href="{{ _link(kind + "_atom", author, language) }}">
99
{% endfor %}
1010
{% elif generate_atom %}
11-
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author }} section" href="{{ _link("author" + "_atom", author) }}">
11+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author|e }} section" href="{{ _link("author" + "_atom", author) }}">
1212
{% endif %}
1313
{% endblock %}

‎nikola/data/themes/base-jinja/templates/authors.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ul class="postlist">
99
{% for text, link in items %}
1010
{% if text not in hidden_authors %}
11-
<li><a class="reference listtitle" href="{{ link }}">{{ text }}</a></li>
11+
<li><a class="reference listtitle" href="{{ link }}">{{ text|e }}</a></li>
1212
{% endif %}
1313
{% endfor %}
1414
</ul>

‎nikola/data/themes/base-jinja/templates/base_header.tmpl

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
{% endmacro %}
1717

1818
{% macro html_site_title() %}
19-
<h1 id="brand"><a href="{{ abs_link(_link("root", None, lang)) }}" title="{{ blog_title }}" rel="home">
19+
<h1 id="brand"><a href="{{ abs_link(_link("root", None, lang)) }}" title="{{ blog_title|e }}" rel="home">
2020
{% if logo_url %}
21-
<img src="{{ logo_url }}" alt="{{ blog_title }}" id="logo">
21+
<img src="{{ logo_url }}" alt="{{ blog_title|e }}" id="logo">
2222
{% endif %}
2323

2424
{% if show_blog_title %}
25-
<span id="blog-title">{{ blog_title }}</span>
25+
<span id="blog-title">{{ blog_title|e }}</span>
2626
{% endif %}
2727
</a></h1>
2828
{% endmacro %}
@@ -32,21 +32,21 @@
3232
<ul>
3333
{% for url, text in navigation_links[lang] %}
3434
{% if isinstance(url, tuple) %}
35-
<li> {{ text }}
35+
<li> {{ text|e }}
3636
<ul>
3737
{% for suburl, text in url %}
3838
{% if rel_link(permalink, suburl) == "#" %}
39-
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
39+
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
4040
{% else %}
41-
<li><a href="{{ suburl }}">{{ text }}</a></li>
41+
<li><a href="{{ suburl }}">{{ text|e }}</a></li>
4242
{% endif %}
4343
{% endfor %}
4444
</ul>
4545
{% else %}
4646
{% if rel_link(permalink, url) == "#" %}
47-
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
47+
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
4848
{% else %}
49-
<li><a href="{{ url }}">{{ text }}</a></li>
49+
<li><a href="{{ url }}">{{ text|e }}</a></li>
5050
{% endif %}
5151
{% endif %}
5252
{% endfor %}

‎nikola/data/themes/base-jinja/templates/base_helper.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lang="{{ lang }}">
2525
<base href="{{ abs_link(permalink) }}">
2626
{% endif %}
2727
{% if description %}
28-
<meta name="description" content="{{ description }}">
28+
<meta name="description" content="{{ description|e }}">
2929
{% endif %}
3030
<meta name="viewport" content="width=device-width">
3131
{% if title == blog_title %}

‎nikola/data/themes/base-jinja/templates/gallery.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
{% if folders %}
1818
<ul>
1919
{% for folder, ftitle in folders %}
20-
<li><a href="{{ folder }}"><i
21-
class="icon-folder-open"></i>&nbsp;{{ ftitle }}</a></li>
20+
<li><a href="{{ folder|urlencode }}"><i
21+
class="icon-folder-open"></i>&nbsp;{{ ftitle|e }}</a></li>
2222
{% endfor %}
2323
</ul>
2424
{% endif %}
2525
{% if photo_array %}
2626
<ul class="thumbnails">
2727
{% for image in photo_array %}
2828
<li><a href="{{ image['url'] }}" class="thumbnail image-reference" title="{{ image['title'] }}">
29-
<img src="{{ image['url_thumb'] }}" alt="{{ image['title'] }}" /></a>
29+
<img src="{{ image['url_thumb'] }}" alt="{{ image['title']|e }}" /></a>
3030
{% endfor %}
3131
</ul>
3232
{% endif %}

‎nikola/data/themes/base-jinja/templates/index.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
{% if author_pages_generated %}
2323
<a href="{{ _link('author', post.author()) }}">{{ post.author() }}</a>
2424
{% else %}
25-
{{ post.author() }}
25+
{{ post.author()|e }}
2626
{% endif %}
2727
</span></p>
28-
<p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format) }}">{{ post.formatted_date(date_format) }}</time></a></p>
28+
<p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></a></p>
2929
{% if not post.meta('nocomments') and site_has_comments %}
3030
<p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }}
3131
{% endif %}

‎nikola/data/themes/base-jinja/templates/index_helper.tmpl

+12-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020

2121
{% macro mathjax_script(posts) %}
2222
{% if posts|selectattr("is_mathjax")|list %}
23-
<script type="text/javascript"
24-
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
25-
</script>
26-
<script type="text/x-mathjax-config">
27-
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
28-
</script>
23+
{% if use_katex %}
24+
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
25+
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/contrib/auto-render.min.js"></script>
26+
<script>
27+
renderMathInElement(document.body);
28+
</script>
29+
{% else %}
30+
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
31+
<script type="text/x-mathjax-config">
32+
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
33+
</script>
34+
{% endif %}
2935
{% endif %}
3036
{% endmacro %}

‎nikola/data/themes/base-jinja/templates/list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
{% block content %}
55
<article class="listpage">
66
<header>
7-
<h1>{{ title }}</h1>
7+
<h1>{{ title|e }}</h1>
88
</header>
99
{% if items %}
1010
<ul class="postlist">
1111
{% for text, link, count in items %}
12-
<li><a href="{{ link }}">{{ text }}</a>
12+
<li><a href="{{ link }}">{{ text|e }}</a>
1313
{% if count %}
1414
({{ count }})
1515
{% endif %}

‎nikola/data/themes/base-jinja/templates/list_post.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
{% block content %}
55
<article class="listpage">
66
<header>
7-
<h1>{{ title }}</h1>
7+
<h1>{{ title|e }}</h1>
88
</header>
99
{% if posts %}
1010
<ul class="postlist">
1111
{% for post in posts %}
12-
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a> <time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format) }}">{{ post.formatted_date(date_format) }}</time></li>
12+
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a> <time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></li>
1313
{% endfor %}
1414
</ul>
1515
{% else %}

‎nikola/data/themes/base-jinja/templates/listing.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
{% if folders or files %}
77
<ul>
88
{% for name in folders %}
9-
<li><a href="{{ name }}"><i class="icon-folder-open"></i> {{ name }}</a>
9+
<li><a href="{{ name|urlencode }}"><i class="icon-folder-open"></i> {{ name|e }}</a>
1010
{% endfor %}
1111
{% for name in files %}
12-
<li><a href="{{ name }}.html"><i class="icon-file"></i> {{ name }}</a>
12+
<li><a href="{{ name|urlencode }}.html"><i class="icon-file"></i> {{ name|e }}</a>
1313
{% endfor %}
1414
</ul>
1515
{% endif %}

‎nikola/data/themes/base-jinja/templates/post.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<meta name="keywords" content="{{ post.meta('keywords')|e }}">
1111
{% endif %}
1212
{% if post.description() %}
13-
<meta name="description" content="{{ post.description() }}">
13+
<meta name="description" content="{{ post.description()|e }}">
1414
{% endif %}
15-
<meta name="author" content="{{ post.author() }}">
15+
<meta name="author" content="{{ post.author()|e }}">
1616
{% if post.prev_post %}
1717
<link rel="prev" href="{{ post.prev_post.permalink() }}" title="{{ post.prev_post.title()|e }}" type="text/html">
1818
{% endif %}

‎nikola/data/themes/base-jinja/templates/post_header.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
<div class="metadata">
3434
<p class="byline author vcard"><span class="byline-name fn">
3535
{% if author_pages_generated %}
36-
<a href="{{ _link('author', post.author()) }}">{{ post.author() }}</a>
36+
<a href="{{ _link('author', post.author()) }}">{{ post.author()|e }}</a>
3737
{% else %}
38-
{{ post.author() }}
38+
{{ post.author()|e }}
3939
{% endif %}
4040
</span></p>
41-
<p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.formatted_date('webiso') }}" itemprop="datePublished" title="{{ post.formatted_date(date_format) }}">{{ post.formatted_date(date_format) }}</time></a></p>
41+
<p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.formatted_date('webiso') }}" itemprop="datePublished" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></a></p>
4242
{% if not post.meta('nocomments') and site_has_comments %}
4343
<p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }}
4444
{% endif %}
@@ -47,7 +47,7 @@
4747
<p class="linkline"><a href="{{ post.meta('link') }}">{{ messages("Original site") }}</a></p>
4848
{% endif %}
4949
{% if post.description() %}
50-
<meta name="description" itemprop="description" content="{{ post.description() }}">
50+
<meta name="description" itemprop="description" content="{{ post.description()|e }}">
5151
{% endif %}
5252
</div>
5353
{{ html_translations(post) }}

‎nikola/data/themes/base-jinja/templates/post_helper.tmpl

+15-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ul itemprop="keywords" class="tags">
1616
{% for tag in post.tags %}
1717
{% if tag not in hidden_tags %}
18-
<li><a class="tag p-category" href="{{ _link('tag', tag) }}" rel="tag">{{ tag }}</a></li>
18+
<li><a class="tag p-category" href="{{ _link('tag', tag) }}" rel="tag">{{ tag|e }}</a></li>
1919
{% endif %}
2020
{% endfor %}
2121
</ul>
@@ -55,14 +55,14 @@
5555
<meta property="og:type" content="article">
5656
{# Will only work with Pintrest and breaks everywhere else who expect a [Facebook] URI. #}
5757
{# %if post.author(): #}
58-
{# <meta property="article:author" content="{{ post.author() }}"> #}
58+
{# <meta property="article:author" content="{{ post.author()|e }}"> #}
5959
{# %endif #}
6060
{% if post.date.isoformat() %}
6161
<meta property="article:published_time" content="{{ post.formatted_date('webiso') }}">
6262
{% endif %}
6363
{% if post.tags %}
6464
{% for tag in post.tags %}
65-
<meta property="article:tag" content="{{ tag }}">
65+
<meta property="article:tag" content="{{ tag|e }}">
6666
{% endfor %}
6767
{% endif %}
6868
{% endif %}
@@ -86,11 +86,17 @@
8686

8787
{% macro mathjax_script(post) %}
8888
{% if post.is_mathjax %}
89-
<script type="text/javascript"
90-
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
91-
</script>
92-
<script type="text/x-mathjax-config">
93-
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
94-
</script>
89+
{% if use_katex %}
90+
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
91+
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/contrib/auto-render.min.js"></script>
92+
<script>
93+
renderMathInElement(document.body);
94+
</script>
95+
{% else %}
96+
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
97+
<script type="text/x-mathjax-config">
98+
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
99+
</script>
100+
{% endif %}
95101
{% endif %}
96102
{% endmacro %}

‎nikola/data/themes/base-jinja/templates/post_list_directive.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ul class="post-list">
77
{% for post in posts %}
88
<li class="post-list-item">
9-
{{ post.formatted_date(date_format) }}
9+
{{ post.formatted_date(date_format)|e }}
1010
&nbsp;
1111
<a href="{{ post.permalink(lang) }}">{{ post.title(lang)|e }}</a>
1212
</li>

‎nikola/data/themes/base-jinja/templates/sectionindex.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
{% block extra_head %}
55
{{ super() }}
66
{% if generate_atom %}
7-
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ posts[0].section_name() }} section" href="{{ _link('section_index_atom', posts[0].section_slug()) }}">
7+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ posts[0].section_name()|e }} section" href="{{ _link('section_index_atom', posts[0].section_slug()) }}">
88
{% endif %}
99
{% endblock %}
1010

1111
{% block content %}
1212
<div class="sectionindex">
1313
<header>
14-
<h2><a href="{{ posts[0].section_link() }}">{{ title }}</a></h2>
14+
<h2><a href="{{ posts[0].section_link() }}">{{ title|e }}</a></h2>
1515
{% if generate_atom %}
1616
<p class="feedlink"><a href="{{ _link('section_index_atom', posts[0].section_slug()) }}" type="application/atom+xml">{{ messages('Updates') }}</a></p>
1717
{% endif %}

‎nikola/data/themes/base-jinja/templates/tag.tmpl

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
{{ super() }}
66
{% if translations|length > 1 and generate_rss %}
77
{% for language in translations|sort %}
8-
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }} ({{ language }})" href="{{ _link(kind + "_rss", tag, language) }}">
8+
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag|e }} ({{ language }})" href="{{ _link(kind + "_rss", tag, language) }}">
99
{% endfor %}
1010
{% elif generate_rss %}
11-
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }}" href="{{ _link(kind + "_rss", tag) }}">
11+
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag|e }}" href="{{ _link(kind + "_rss", tag) }}">
1212
{% endif %}
1313
{% endblock %}
1414

@@ -18,13 +18,13 @@
1818
<header>
1919
<h1>{{ title|e }}</h1>
2020
{% if description %}
21-
<p>{{ description }}</p>
21+
<p>{{ description|e }}</p>
2222
{% endif %}
2323
{% if subcategories %}
2424
{{ messages('Subcategories:') }}
2525
<ul>
2626
{% for name, link in subcategories %}
27-
<li><a href="{{ link }}">{{ name }}</a></li>
27+
<li><a href="{{ link }}">{{ name|e }}</a></li>
2828
{% endfor %}
2929
</ul>
3030
{% endif %}
@@ -43,7 +43,7 @@
4343
{% if posts %}
4444
<ul class="postlist">
4545
{% for post in posts %}
46-
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format) }}">{{ post.formatted_date(date_format) }}</time><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}<a></li>
46+
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}<a></li>
4747
{% endfor %}
4848
</ul>
4949
{% endif %}

‎nikola/data/themes/base-jinja/templates/tagindex.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ messages('Subcategories:') }}
77
<ul>
88
{% for name, link in subcategories %}
9-
<li><a href="{{ link }}">{{ name }}</a></li>
9+
<li><a href="{{ link }}">{{ name|e }}</a></li>
1010
{% endfor %}
1111
</ul>
1212
{% endif %}
@@ -16,9 +16,9 @@
1616
{{ super() }}
1717
{% if translations|length > 1 and generate_atom %}
1818
{% for language in translations|sort %}
19-
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section ({{ language }})" href="{{ _link(kind + "_atom", tag, language) }}">
19+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag|e }} section ({{ language }})" href="{{ _link(kind + "_atom", tag, language) }}">
2020
{% endfor %}
2121
{% elif generate_atom %}
22-
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section" href="{{ _link("tag" + "_atom", tag) }}">
22+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag|e }} section" href="{{ _link("tag" + "_atom", tag) }}">
2323
{% endif %}
2424
{% endblock %}

‎nikola/data/themes/base-jinja/templates/tags.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block content %}
55
<article class="tagindex">
66
<header>
7-
<h1>{{ title }}</h1>
7+
<h1>{{ title|e }}</h1>
88
</header>
99
{% if cat_items %}
1010
{% if items %}
@@ -33,7 +33,7 @@
3333
<ul class="postlist">
3434
{% for text, link in items %}
3535
{% if text not in hidden_tags %}
36-
<li><a class="reference listtitle" href="{{ link }}">{{ text }}</a></li>
36+
<li><a class="reference listtitle" href="{{ link }}">{{ text|e }}</a></li>
3737
{% endif %}
3838
{% endfor %}
3939
</ul>

‎nikola/data/themes/bootstrap3-jinja/templates/authors.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ul class="list-inline">
1010
{% for text, link in items %}
1111
{% if text not in hidden_authors %}
12-
<li><a class="reference badge" href="{{ link }}">{{ text }}</a></li>
12+
<li><a class="reference badge" href="{{ link }}">{{ text|e }}</a></li>
1313
{% endif %}
1414
{% endfor %}
1515
</ul>

‎nikola/data/themes/bootstrap3-jinja/templates/base.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
</button>
2525
<a class="navbar-brand" href="{{ abs_link(_link("root", None, lang)) }}">
2626
{% if logo_url %}
27-
<img src="{{ logo_url }}" alt="{{ blog_title }}" id="logo">
27+
<img src="{{ logo_url }}" alt="{{ blog_title|e }}" id="logo">
2828
{% endif %}
2929

3030
{% if show_blog_title %}
31-
<span id="blog-title">{{ blog_title }}</span>
31+
<span id="blog-title">{{ blog_title|e }}</span>
3232
{% endif %}
3333
</a>
3434
</div><!-- /.navbar-header -->

‎nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ lang="{{ lang }}">
3030
<base href="{{ abs_link(permalink) }}">
3131
{% endif %}
3232
{% if description %}
33-
<meta name="description" content="{{ description }}">
33+
<meta name="description" content="{{ description|e }}">
3434
{% endif %}
3535
<meta name="viewport" content="width=device-width, initial-scale=1">
3636
{% if title == blog_title %}
@@ -135,21 +135,21 @@ lang="{{ lang }}">
135135
{% macro html_navigation_links() %}
136136
{% for url, text in navigation_links[lang] %}
137137
{% if isinstance(url, tuple) %}
138-
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ text }} <b class="caret"></b></a>
138+
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ text|e }} <b class="caret"></b></a>
139139
<ul class="dropdown-menu">
140140
{% for suburl, text in url %}
141141
{% if rel_link(permalink, suburl) == "#" %}
142-
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
142+
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
143143
{% else %}
144-
<li><a href="{{ suburl }}">{{ text }}</a>
144+
<li><a href="{{ suburl }}">{{ text|e }}</a>
145145
{% endif %}
146146
{% endfor %}
147147
</ul>
148148
{% else %}
149149
{% if rel_link(permalink, url) == "#" %}
150-
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
150+
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a>
151151
{% else %}
152-
<li><a href="{{ url }}">{{ text }}</a>
152+
<li><a href="{{ url }}">{{ text|e }}</a>
153153
{% endif %}
154154
{% endif %}
155155
{% endfor %}

‎nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% if folders %}
1818
<ul>
1919
{% for folder, ftitle in folders %}
20-
<li><a href="{{ folder }}"><i class="glyphicon glyphicon-folder-open"></i>&nbsp;{{ ftitle }}</a></li>
20+
<li><a href="{{ folder }}"><i class="glyphicon glyphicon-folder-open"></i>&nbsp;{{ ftitle|e }}</a></li>
2121
{% endfor %}
2222
</ul>
2323
{% endif %}
@@ -27,8 +27,8 @@
2727
<noscript>
2828
<ul class="thumbnails">
2929
{% for image in photo_array %}
30-
<li><a href="{{ image['url'] }}" class="thumbnail image-reference" title="{{ image['title'] }}">
31-
<img src="{{ image['url_thumb'] }}" alt="{{ image['title'] }}" /></a>
30+
<li><a href="{{ image['url'] }}" class="thumbnail image-reference" title="{{ image['title']|e }}">
31+
<img src="{{ image['url_thumb'] }}" alt="{{ image['title']|e }}" /></a>
3232
{% endfor %}
3333
</ul>
3434
</noscript>

‎nikola/data/themes/bootstrap3-jinja/templates/listing.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
{% if folders or files %}
88
<ul class="list-unstyled">
99
{% for name in folders %}
10-
<li><a href="{{ name }}"><i class="glyphicon glyphicon-folder-open"></i> {{ name }}</a>
10+
<li><a href="{{ name|urlencode }}"><i class="glyphicon glyphicon-folder-open"></i> {{ name|e }}</a>
1111
{% endfor %}
1212
{% for name in files %}
13-
<li><a href="{{ name }}.html"><i class="glyphicon glyphicon-file"></i> {{ name }}</a>
13+
<li><a href="{{ name|urlencode }}.html"><i class="glyphicon glyphicon-file"></i> {{ name|e }}</a>
1414
{% endfor %}
1515
</ul>
1616
{% endif %}

‎nikola/data/themes/bootstrap3-jinja/templates/post.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<meta name="keywords" content="{{ post.meta('keywords')|e }}">
1111
{% endif %}
1212
{% if post.description() %}
13-
<meta name="description" itemprop="description" content="{{ post.description() }}">
13+
<meta name="description" itemprop="description" content="{{ post.description()|e }}">
1414
{% endif %}
15-
<meta name="author" content="{{ post.author() }}">
15+
<meta name="author" content="{{ post.author()|e }}">
1616
{% if post.prev_post %}
1717
<link rel="prev" href="{{ post.prev_post.permalink() }}" title="{{ post.prev_post.title()|e }}" type="text/html">
1818
{% endif %}

‎nikola/data/themes/bootstrap3-jinja/templates/tags.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% extends 'base.tmpl' %}
33

44
{% block content %}
5-
<h1>{{ title }}</h1>
5+
<h1>{{ title|e }}</h1>
66
{% if cat_items %}
77
{% if items %}
88
<h2>{{ messages("Categories") }}</h2>
@@ -11,7 +11,7 @@
1111
{% for i in range(indent_change_before) %}
1212
<ul class="list-inline">
1313
{% endfor %}
14-
<li><a class="reference badge" href="{{ link }}">{{ text }}</a>
14+
<li><a class="reference badge" href="{{ link }}">{{ text|e }}</a>
1515
{% if indent_change_after <= 0 %}
1616
</li>
1717
{% endif %}
@@ -30,7 +30,7 @@
3030
<ul class="list-inline">
3131
{% for text, link in items %}
3232
{% if text not in hidden_tags %}
33-
<li><a class="reference badge" href="{{ link }}">{{ text }}</a></li>
33+
<li><a class="reference badge" href="{{ link }}">{{ text|e }}</a></li>
3434
{% endif %}
3535
{% endfor %}
3636
</ul>

0 commit comments

Comments
 (0)
Please sign in to comment.