Skip to content

Commit 8c2c32b

Browse files
committedMay 5, 2015
jinjify and add Atom links to bootstrap themes (cc @Aeyoun)
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent e1c0d78 commit 8c2c32b

File tree

7 files changed

+67
-0
lines changed

7 files changed

+67
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
{# -*- coding: utf-8 -*- #}
22
{% extends 'index.tmpl' %}
3+
4+
{% block extra_head %}
5+
{{ super() }}
6+
{% if translations|length > 1 and generate_atom %}
7+
{% for language in translations %}
8+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ archive_name }} section ({{ language }})" href="{{ _link("archive_atom", archive_name, language) }}">
9+
{% endfor %}
10+
{% elif generate_atom %}
11+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ archive_name }} archive" href="{{ _link("archive_atom", archive_name) }}">
12+
{% endif %}
13+
{% endblock %}

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

+9
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ lang="{{ lang }}">
9393
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
9494
{% endif %}
9595
{% endif %}
96+
{% if generate_atom %}
97+
{% if translations|length > 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 %}
96105
{% endmacro %}
97106

98107
{% macro html_translations() %}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
{# -*- coding: utf-8 -*- #}
22
{% extends 'index.tmpl' %}
3+
4+
{% block extra_head %}
5+
{{ super() }}
6+
{% if translations|length > 1 and generate_atom %}
7+
{% for language in translations %}
8+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section ({{ language }})" href="{{ _link(kind + "_atom", tag, language) }}">
9+
{% endfor %}
10+
{% elif generate_atom %}
11+
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} section" href="{{ _link("tag" + "_atom", tag) }}">
12+
{% endif %}
13+
{% endblock %}

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

+9
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ lang="{{ lang }}">
160160
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
161161
{% endif %}
162162
{% endif %}
163+
{% if generate_atom %}
164+
{% if translations|length > 1 %}
165+
{% for language in translations %}
166+
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
167+
{% endfor %}
168+
{% else %}
169+
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
170+
{% endif %}
171+
{% endif %}
163172
{% endmacro %}
164173

165174
{% macro html_translations() %}

‎nikola/data/themes/bootstrap/templates/base_helper.tmpl

+9
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ lang="${lang}">
160160
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
161161
%endif
162162
%endif
163+
%if generate_atom:
164+
%if len(translations) > 1:
165+
%for language in translations:
166+
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
167+
%endfor
168+
%else:
169+
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
170+
%endif
171+
%endif
163172
</%def>
164173

165174
<%def name="html_translations()">

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

+9
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ lang="{{ lang }}">
157157
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
158158
{% endif %}
159159
{% endif %}
160+
{% if generate_atom %}
161+
{% if translations|length > 1 %}
162+
{% for language in translations %}
163+
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
164+
{% endfor %}
165+
{% else %}
166+
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
167+
{% endif %}
168+
{% endif %}
160169
{% endmacro %}
161170

162171
{% macro html_translations() %}

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

+9
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ lang="${lang}">
157157
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
158158
%endif
159159
%endif
160+
%if generate_atom:
161+
%if len(translations) > 1:
162+
%for language in translations:
163+
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
164+
%endfor
165+
%else:
166+
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
167+
%endif
168+
%endif
160169
</%def>
161170

162171
<%def name="html_translations()">

0 commit comments

Comments
 (0)
Please sign in to comment.