Skip to content
Permalink
Browse files
Jinjify
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 12, 2015
1 parent 666459e commit 7122250953b0f4313d1abb585deb0ca965f7391d
Showing with 92 additions and 80 deletions.
  1. +4 −4 nikola/data/themes/base-jinja/templates/author.tmpl
  2. +2 −2 nikola/data/themes/base-jinja/templates/authorindex.tmpl
  3. +1 −1 nikola/data/themes/base-jinja/templates/authors.tmpl
  4. +8 −8 nikola/data/themes/base-jinja/templates/base_header.tmpl
  5. +1 −1 nikola/data/themes/base-jinja/templates/base_helper.tmpl
  6. +3 −3 nikola/data/themes/base-jinja/templates/gallery.tmpl
  7. +2 −2 nikola/data/themes/base-jinja/templates/index.tmpl
  8. +12 −6 nikola/data/themes/base-jinja/templates/index_helper.tmpl
  9. +2 −2 nikola/data/themes/base-jinja/templates/list.tmpl
  10. +2 −2 nikola/data/themes/base-jinja/templates/list_post.tmpl
  11. +2 −2 nikola/data/themes/base-jinja/templates/listing.tmpl
  12. +2 −2 nikola/data/themes/base-jinja/templates/post.tmpl
  13. +4 −4 nikola/data/themes/base-jinja/templates/post_header.tmpl
  14. +15 −9 nikola/data/themes/base-jinja/templates/post_helper.tmpl
  15. +1 −1 nikola/data/themes/base-jinja/templates/post_list_directive.tmpl
  16. +2 −2 nikola/data/themes/base-jinja/templates/sectionindex.tmpl
  17. +5 −5 nikola/data/themes/base-jinja/templates/tag.tmpl
  18. +3 −3 nikola/data/themes/base-jinja/templates/tagindex.tmpl
  19. +2 −2 nikola/data/themes/base-jinja/templates/tags.tmpl
  20. +1 −1 nikola/data/themes/bootstrap3-jinja/templates/authors.tmpl
  21. +2 −2 nikola/data/themes/bootstrap3-jinja/templates/base.tmpl
  22. +6 −6 nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl
  23. +3 −3 nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl
  24. +2 −2 nikola/data/themes/bootstrap3-jinja/templates/listing.tmpl
  25. +2 −2 nikola/data/themes/bootstrap3-jinja/templates/post.tmpl
  26. +3 −3 nikola/data/themes/bootstrap3-jinja/templates/tags.tmpl
@@ -5,10 +5,10 @@
{{ super() }}
{% if translations|length > 1 and generate_rss %}
{% for language in translations|sort %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author }} ({{ language }})" href="{{ _link(kind + "_rss", author, language) }}">
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author|e }} ({{ language }})" href="{{ _link(kind + "_rss", author, language) }}">
{% endfor %}
{% elif generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author }}" href="{{ _link(kind + "_rss", author) }}">
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ author|e }}" href="{{ _link(kind + "_rss", author) }}">
{% endif %}
{% endblock %}

@@ -18,7 +18,7 @@
<header>
<h1>{{ title|e }}</h1>
{% if description %}
<p>{{ description }}</p>
<p>{{ description|e }}</p>
{% endif %}
<div class="metadata">
{% if translations|length > 1 and generate_rss %}
@@ -35,7 +35,7 @@
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<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>
<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>
{% endfor %}
</ul>
{% endif %}
@@ -5,9 +5,9 @@
{{ super() }}
{% if tranlations|length > 1 and generate_atom %}
{% for language in translations|sort %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author }} section ({{ language }})" href="{{ _link(kind + "_atom", author, language) }}">
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author|e }} section ({{ language }})" href="{{ _link(kind + "_atom", author, language) }}">
{% endfor %}
{% elif generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author }} section" href="{{ _link("author" + "_atom", author) }}">
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ author|e }} section" href="{{ _link("author" + "_atom", author) }}">
{% endif %}
{% endblock %}
@@ -8,7 +8,7 @@
<ul class="postlist">
{% for text, link in items %}
{% if text not in hidden_authors %}
<li><a class="reference listtitle" href="{{ link }}">{{ text }}</a></li>
<li><a class="reference listtitle" href="{{ link }}">{{ text|e }}</a></li>
{% endif %}
{% endfor %}
</ul>
@@ -16,13 +16,13 @@
{% endmacro %}

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

{% if show_blog_title %}
<span id="blog-title">{{ blog_title }}</span>
<span id="blog-title">{{ blog_title|e }}</span>
{% endif %}
</a></h1>
{% endmacro %}
@@ -32,21 +32,21 @@
<ul>
{% for url, text in navigation_links[lang] %}
{% if isinstance(url, tuple) %}
<li> {{ text }}
<li> {{ text|e }}
<ul>
{% 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></li>
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
{% else %}
<li><a href="{{ suburl }}">{{ text }}</a></li>
<li><a href="{{ suburl }}">{{ text|e }}</a></li>
{% 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></li>
<li class="active"><a href="{{ permalink }}">{{ text|e }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
{% else %}
<li><a href="{{ url }}">{{ text }}</a></li>
<li><a href="{{ url }}">{{ text|e }}</a></li>
{% endif %}
{% endif %}
{% endfor %}
@@ -25,7 +25,7 @@ lang="{{ lang }}">
<base href="{{ abs_link(permalink) }}">
{% endif %}
{% if description %}
<meta name="description" content="{{ description }}">
<meta name="description" content="{{ description|e }}">
{% endif %}
<meta name="viewport" content="width=device-width">
{% if title == blog_title %}
@@ -17,16 +17,16 @@
{% if folders %}
<ul>
{% for folder, ftitle in folders %}
<li><a href="{{ folder }}"><i
class="icon-folder-open"></i>&nbsp;{{ ftitle }}</a></li>
<li><a href="{{ folder|urlencode }}"><i
class="icon-folder-open"></i>&nbsp;{{ ftitle|e }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if photo_array %}
<ul class="thumbnails">
{% for image in photo_array %}
<li><a href="{{ image['url'] }}" class="thumbnail image-reference" title="{{ image['title'] }}">
<img src="{{ image['url_thumb'] }}" alt="{{ image['title'] }}" /></a>
<img src="{{ image['url_thumb'] }}" alt="{{ image['title']|e }}" /></a>
{% endfor %}
</ul>
{% endif %}
@@ -22,10 +22,10 @@
{% if author_pages_generated %}
<a href="{{ _link('author', post.author()) }}">{{ post.author() }}</a>
{% else %}
{{ post.author() }}
{{ post.author()|e }}
{% endif %}
</span></p>
<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>
<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>
{% if not post.meta('nocomments') and site_has_comments %}
<p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }}
{% endif %}
@@ -20,11 +20,17 @@

{% macro mathjax_script(posts) %}
{% if posts|selectattr("is_mathjax")|list %}
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% if use_katex %}
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/contrib/auto-render.min.js"></script>
<script>
renderMathInElement(document.body);
</script>
{% else %}
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% endif %}
{% endif %}
{% endmacro %}
@@ -4,12 +4,12 @@
{% block content %}
<article class="listpage">
<header>
<h1>{{ title }}</h1>
<h1>{{ title|e }}</h1>
</header>
{% if items %}
<ul class="postlist">
{% for text, link, count in items %}
<li><a href="{{ link }}">{{ text }}</a>
<li><a href="{{ link }}">{{ text|e }}</a>
{% if count %}
({{ count }})
{% endif %}
@@ -4,12 +4,12 @@
{% block content %}
<article class="listpage">
<header>
<h1>{{ title }}</h1>
<h1>{{ title|e }}</h1>
</header>
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<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>
<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>
{% endfor %}
</ul>
{% else %}
@@ -6,10 +6,10 @@
{% if folders or files %}
<ul>
{% for name in folders %}
<li><a href="{{ name }}"><i class="icon-folder-open"></i> {{ name }}</a>
<li><a href="{{ name|urlencode }}"><i class="icon-folder-open"></i> {{ name|e }}</a>
{% endfor %}
{% for name in files %}
<li><a href="{{ name }}.html"><i class="icon-file"></i> {{ name }}</a>
<li><a href="{{ name|urlencode }}.html"><i class="icon-file"></i> {{ name|e }}</a>
{% endfor %}
</ul>
{% endif %}
@@ -10,9 +10,9 @@
<meta name="keywords" content="{{ post.meta('keywords')|e }}">
{% endif %}
{% if post.description() %}
<meta name="description" content="{{ post.description() }}">
<meta name="description" content="{{ post.description()|e }}">
{% endif %}
<meta name="author" content="{{ post.author() }}">
<meta name="author" content="{{ post.author()|e }}">
{% if post.prev_post %}
<link rel="prev" href="{{ post.prev_post.permalink() }}" title="{{ post.prev_post.title()|e }}" type="text/html">
{% endif %}
@@ -33,12 +33,12 @@
<div class="metadata">
<p class="byline author vcard"><span class="byline-name fn">
{% if author_pages_generated %}
<a href="{{ _link('author', post.author()) }}">{{ post.author() }}</a>
<a href="{{ _link('author', post.author()) }}">{{ post.author()|e }}</a>
{% else %}
{{ post.author() }}
{{ post.author()|e }}
{% endif %}
</span></p>
<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>
<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>
{% if not post.meta('nocomments') and site_has_comments %}
<p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }}
{% endif %}
@@ -47,7 +47,7 @@
<p class="linkline"><a href="{{ post.meta('link') }}">{{ messages("Original site") }}</a></p>
{% endif %}
{% if post.description() %}
<meta name="description" itemprop="description" content="{{ post.description() }}">
<meta name="description" itemprop="description" content="{{ post.description()|e }}">
{% endif %}
</div>
{{ html_translations(post) }}
@@ -15,7 +15,7 @@
<ul itemprop="keywords" class="tags">
{% for tag in post.tags %}
{% if tag not in hidden_tags %}
<li><a class="tag p-category" href="{{ _link('tag', tag) }}" rel="tag">{{ tag }}</a></li>
<li><a class="tag p-category" href="{{ _link('tag', tag) }}" rel="tag">{{ tag|e }}</a></li>
{% endif %}
{% endfor %}
</ul>
@@ -55,14 +55,14 @@
<meta property="og:type" content="article">
{# Will only work with Pintrest and breaks everywhere else who expect a [Facebook] URI. #}
{# %if post.author(): #}
{# <meta property="article:author" content="{{ post.author() }}"> #}
{# <meta property="article:author" content="{{ post.author()|e }}"> #}
{# %endif #}
{% if post.date.isoformat() %}
<meta property="article:published_time" content="{{ post.formatted_date('webiso') }}">
{% endif %}
{% if post.tags %}
{% for tag in post.tags %}
<meta property="article:tag" content="{{ tag }}">
<meta property="article:tag" content="{{ tag|e }}">
{% endfor %}
{% endif %}
{% endif %}
@@ -86,11 +86,17 @@

{% macro mathjax_script(post) %}
{% if post.is_mathjax %}
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% if use_katex %}
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/contrib/auto-render.min.js"></script>
<script>
renderMathInElement(document.body);
</script>
{% else %}
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% endif %}
{% endif %}
{% endmacro %}
@@ -6,7 +6,7 @@
<ul class="post-list">
{% for post in posts %}
<li class="post-list-item">
{{ post.formatted_date(date_format) }}
{{ post.formatted_date(date_format)|e }}
&nbsp;
<a href="{{ post.permalink(lang) }}">{{ post.title(lang)|e }}</a>
</li>
@@ -4,14 +4,14 @@
{% block extra_head %}
{{ super() }}
{% if generate_atom %}
<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()) }}">
<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()) }}">
{% endif %}
{% endblock %}

{% block content %}
<div class="sectionindex">
<header>
<h2><a href="{{ posts[0].section_link() }}">{{ title }}</a></h2>
<h2><a href="{{ posts[0].section_link() }}">{{ title|e }}</a></h2>
{% if generate_atom %}
<p class="feedlink"><a href="{{ _link('section_index_atom', posts[0].section_slug()) }}" type="application/atom+xml">{{ messages('Updates') }}</a></p>
{% endif %}
@@ -5,10 +5,10 @@
{{ super() }}
{% if translations|length > 1 and generate_rss %}
{% for language in translations|sort %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }} ({{ language }})" href="{{ _link(kind + "_rss", tag, language) }}">
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag|e }} ({{ language }})" href="{{ _link(kind + "_rss", tag, language) }}">
{% endfor %}
{% elif generate_rss %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }}" href="{{ _link(kind + "_rss", tag) }}">
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ tag|e }}" href="{{ _link(kind + "_rss", tag) }}">
{% endif %}
{% endblock %}

@@ -18,13 +18,13 @@
<header>
<h1>{{ title|e }}</h1>
{% if description %}
<p>{{ description }}</p>
<p>{{ description|e }}</p>
{% endif %}
{% if subcategories %}
{{ messages('Subcategories:') }}
<ul>
{% for name, link in subcategories %}
<li><a href="{{ link }}">{{ name }}</a></li>
<li><a href="{{ link }}">{{ name|e }}</a></li>
{% endfor %}
</ul>
{% endif %}
@@ -43,7 +43,7 @@
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<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>
<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>
{% endfor %}
</ul>
{% endif %}
@@ -6,7 +6,7 @@
{{ messages('Subcategories:') }}
<ul>
{% for name, link in subcategories %}
<li><a href="{{ link }}">{{ name }}</a></li>
<li><a href="{{ link }}">{{ name|e }}</a></li>
{% endfor %}
</ul>
{% endif %}
@@ -16,9 +16,9 @@
{{ super() }}
{% if translations|length > 1 and generate_atom %}
{% for language in translations|sort %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section ({{ language }})" href="{{ _link(kind + "_atom", tag, language) }}">
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag|e }} section ({{ language }})" href="{{ _link(kind + "_atom", tag, language) }}">
{% endfor %}
{% elif generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section" href="{{ _link("tag" + "_atom", tag) }}">
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag|e }} section" href="{{ _link("tag" + "_atom", tag) }}">
{% endif %}
{% endblock %}
@@ -4,7 +4,7 @@
{% block content %}
<article class="tagindex">
<header>
<h1>{{ title }}</h1>
<h1>{{ title|e }}</h1>
</header>
{% if cat_items %}
{% if items %}
@@ -33,7 +33,7 @@
<ul class="postlist">
{% for text, link in items %}
{% if text not in hidden_tags %}
<li><a class="reference listtitle" href="{{ link }}">{{ text }}</a></li>
<li><a class="reference listtitle" href="{{ link }}">{{ text|e }}</a></li>
{% endif %}
{% endfor %}
</ul>
Loading

0 comments on commit 7122250

Please sign in to comment.