Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
jinjify and add Atom links to bootstrap themes (cc @Aeyoun)
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 5, 2015
1 parent e1c0d78 commit 8c2c32b
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nikola/data/themes/base-jinja/templates/archiveindex.tmpl
@@ -1,2 +1,13 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}

{% block extra_head %}
{{ super() }}
{% if translations|length > 1 and generate_atom %}
{% for language in translations %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ archive_name }} section ({{ language }})" href="{{ _link("archive_atom", archive_name, language) }}">
{% endfor %}
{% elif generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ archive_name }} archive" href="{{ _link("archive_atom", archive_name) }}">
{% endif %}
{% endblock %}
9 changes: 9 additions & 0 deletions nikola/data/themes/base-jinja/templates/base_helper.tmpl
Expand Up @@ -93,6 +93,15 @@ lang="{{ lang }}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
{% endif %}
{% endif %}
{% if generate_atom %}
{% if translations|length > 1 %}
{% for language in translations %}
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
{% endfor %}
{% else %}
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
{% endif %}
{% endif %}
{% endmacro %}

{% macro html_translations() %}
Expand Down
11 changes: 11 additions & 0 deletions nikola/data/themes/base-jinja/templates/tagindex.tmpl
@@ -1,2 +1,13 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}

{% block extra_head %}
{{ super() }}
{% if translations|length > 1 and generate_atom %}
{% for language in translations %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ tag }} 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) }}">
{% endif %}
{% endblock %}
9 changes: 9 additions & 0 deletions nikola/data/themes/bootstrap-jinja/templates/base_helper.tmpl
Expand Up @@ -160,6 +160,15 @@ lang="{{ lang }}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
{% endif %}
{% endif %}
{% if generate_atom %}
{% if translations|length > 1 %}
{% for language in translations %}
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
{% endfor %}
{% else %}
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
{% endif %}
{% endif %}
{% endmacro %}

{% macro html_translations() %}
Expand Down
9 changes: 9 additions & 0 deletions nikola/data/themes/bootstrap/templates/base_helper.tmpl
Expand Up @@ -160,6 +160,15 @@ lang="${lang}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
%endif
%endif
%if generate_atom:
%if len(translations) > 1:
%for language in translations:
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
%endfor
%else:
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
%endif
%endif
</%def>

<%def name="html_translations()">
Expand Down
Expand Up @@ -157,6 +157,15 @@ lang="{{ lang }}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
{% endif %}
{% endif %}
{% if generate_atom %}
{% if translations|length > 1 %}
{% for language in translations %}
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
{% endfor %}
{% else %}
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
{% endif %}
{% endif %}
{% endmacro %}

{% macro html_translations() %}
Expand Down
9 changes: 9 additions & 0 deletions nikola/data/themes/bootstrap3/templates/base_helper.tmpl
Expand Up @@ -157,6 +157,15 @@ lang="${lang}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
%endif
%endif
%if generate_atom:
%if len(translations) > 1:
%for language in translations:
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
%endfor
%else:
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
%endif
%endif
</%def>

<%def name="html_translations()">
Expand Down

0 comments on commit 8c2c32b

Please sign in to comment.