Skip to content
Permalink
Browse files
Renaming feed_helper.tmpl -> translation_link_helper.tmpl and moving …
…code for alternate links into there.
  • Loading branch information
felixfontein committed Jun 8, 2017
1 parent 16804f0 commit f2ad9b3a734bda03f91cbc6a2fa090a5dbb2ae1e
Showing 24 changed files with 72 additions and 90 deletions.
@@ -1,11 +1,11 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block extra_head %}
{{ super() }}
{{ feed.head(archive_name) }}
{{ translation_links.head(archive_name) }}
{% endblock %}

{% block content_header %}
@@ -1,10 +1,10 @@
{# -*- coding: utf-8 -*- #}
{% extends 'list_post.tmpl' %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block extra_head %}
{{ super() }}
{{ feed.head(author) }}
{{ translation_links.head(author) }}
{% endblock %}


@@ -16,7 +16,7 @@
<p>{{ description }}</p>
{% endif %}
<div class="metadata">
{{ feed.link(author) }}
{{ translation_links.link(author) }}
</div>
</header>
{% if posts %}
@@ -1,8 +1,8 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block extra_head %}
{{ super() }}
{{ feed.head(author) }}
{{ translation_links.head(author) }}
{% endblock %}
@@ -1,5 +1,5 @@
{# -*- coding: utf-8 -*- #}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% macro html_headstart() %}
<!DOCTYPE html>
@@ -42,7 +42,7 @@ lang="{{ lang }}">
{% if meta_generator_tag %}
<meta name="generator" content="Nikola (getnikola.com)">
{% endif %}
{{ feed.head() }}
{{ translation_links.head() }}
<link rel="canonical" href="{{ abs_link(permalink) }}">

{% if favicons %}
@@ -100,7 +100,7 @@ lang="{{ lang }}">

{# This function is deprecated; use feed_helper directly. #}
{% macro html_feedlinks() %}
{{ feed.head() }}
{{ translation_links.head() }}
{% endmacro %}

{% macro html_translations() %}
@@ -11,11 +11,6 @@
<link rel="prefetch" href="{{ posts[0].permalink() }}" type="text/html">
{% endif %}
{{ math.math_styles_ifposts(posts) }}
{% if has_other_languages and other_languages %}
{% for language, classification, _ in other_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link(kind, classification, language) }}">
{% endfor %}
{% endif %}
{% endblock %}

{% block content %}
@@ -24,7 +19,11 @@
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, classification, name in other_languages %}
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }} ({{ name|e }})</a></p>
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}
{% if kind != 'archive' %}
({{ name|e }})
{% endif %}
</a></p>
{% endfor %}
</div>
{% endif %}
@@ -2,14 +2,6 @@
{% extends 'base.tmpl' %}
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}

{% block extra_head %}
{% if has_other_languages and other_languages %}
{% for language, classification, _ in other_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link(kind, classification, language) }}">
{% endfor %}
{% endif %}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
@@ -20,7 +12,11 @@
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, classification, name in other_languages %}
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }} ({{ name|e }})</a></p>
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}
{% if kind != 'archive' %}
({{ name|e }})
{% endif %}
</a></p>
{% endfor %}
</div>
{% endif %}
@@ -2,14 +2,6 @@
{% extends 'base.tmpl' %}
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}

{% block extra_head %}
{% if has_other_languages and other_languages %}
{% for language, classification, _ in other_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link(kind, classification, language) }}">
{% endfor %}
{% endif %}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
@@ -20,7 +12,11 @@
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, classification, name in other_languages %}
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }} ({{ name|e }})</a></p>
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}
{% if kind != 'archive' %}
({{ name|e }})
{% endif %}
</a></p>
{% endfor %}
</div>
{% endif %}
@@ -1,17 +1,17 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block extra_head %}
{{ super() }}
{{ feed.head(section) }}
{{ translation_links.head(section) }}
{% endblock %}

{% block content %}
<div class="sectionindex">
<header>
<h2><a href="{{ _link('section_index', section) }}">{{ title|e }}</a></h2>
{{ feed.link(section) }}
{{ translation_links.link(section) }}
</header>
{{ super() }}
</div>
@@ -1,10 +1,10 @@
{# -*- coding: utf-8 -*- #}
{% extends 'list_post.tmpl' %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block extra_head %}
{{ super() }}
{{ feed.head(tag) }}
{{ translation_links.head(tag) }}
{% endblock %}


@@ -24,13 +24,17 @@
</ul>
{% endif %}
<div class="metadata">
{{ feed.link(tag) }}
{{ translation_links.link(tag) }}
</div>
{% if has_other_languages and other_languages %}
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, classification, name in other_languages %}
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }} ({{ name|e }})</a></p>
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}
{% if kind != 'archive' %}
({{ name|e }})
{% endif %}
</a></p>
{% endfor %}
</div>
{% endif %}
@@ -1,6 +1,6 @@
{# -*- coding: utf-8 -*- #}
{% extends 'index.tmpl' %}
{% import 'feed_helper.tmpl' as feed with context %}
{% import 'translation_link_helper.tmpl' as translation_links with context %}

{% block content_header %}
{{ parent.content_header() }}
@@ -22,5 +22,5 @@

{% block extra_head %}
{{ super() }}
{{ feed.head(tag) }}
{{ translation_links.head(tag) }}
{% endblock %}
@@ -38,6 +38,11 @@
{% endif %}
{% endif %}
{% endif %}
{% if has_other_languages and other_languages %}
{% for language, classification, _ in other_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link(kind, classification, language) }}">
{% endfor %}
{% endif %}
{% endmacro %}

{% macro link(classification) %}
@@ -1,11 +1,11 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
${feed.head(archive_name)}
${translation_links.head(archive_name)}
</%block>

<%block name="content_header">
@@ -1,10 +1,10 @@
## -*- coding: utf-8 -*-
<%inherit file="list_post.tmpl"/>
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
${feed.head(author)}
${translation_links.head(author)}
</%block>


@@ -16,7 +16,7 @@
<p>${description}</p>
%endif
<div class="metadata">
${feed.link(author)}
${translation_links.link(author)}
</div>
</header>
%if posts:
@@ -1,8 +1,8 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
${feed.head(author)}
${translation_links.head(author)}
</%block>
@@ -1,5 +1,5 @@
## -*- coding: utf-8 -*-
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%def name="html_headstart()">
<!DOCTYPE html>
@@ -42,7 +42,7 @@ lang="${lang}">
% if meta_generator_tag:
<meta name="generator" content="Nikola (getnikola.com)">
% endif
${feed.head()}
${translation_links.head()}
<link rel="canonical" href="${abs_link(permalink)}">

%if favicons:
@@ -100,7 +100,7 @@ lang="${lang}">

### This function is deprecated; use feed_helper directly.
<%def name="html_feedlinks()">
${feed.head()}
${translation_links.head()}
</%def>

<%def name="html_translations()">
@@ -11,11 +11,6 @@
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
% endif
${math.math_styles_ifposts(posts)}
%if has_other_languages and other_languages:
%for language, classification, _ in other_languages:
<link rel="alternate" hreflang="${language}" href="${_link(kind, classification, language)}">
%endfor
%endif
</%block>

<%block name="content">
@@ -2,14 +2,6 @@
<%inherit file="base.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>

<%block name="extra_head">
%if has_other_languages and other_languages:
%for language, classification, _ in other_languages:
<link rel="alternate" hreflang="${language}" href="${_link(kind, classification, language)}">
%endfor
%endif
</%block>

<%block name="content">
<article class="listpage">
<header>
@@ -2,14 +2,6 @@
<%inherit file="base.tmpl"/>
<%namespace name="archive_nav" file="archive_navigation_helper.tmpl" import="*"/>

<%block name="extra_head">
%if has_other_languages and other_languages:
%for language, classification, _ in other_languages:
<link rel="alternate" hreflang="${language}" href="${_link(kind, classification, language)}">
%endfor
%endif
</%block>

<%block name="content">
<article class="listpage">
<header>
@@ -1,17 +1,17 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
${feed.head(section)}
${translation_links.head(section)}
</%block>

<%block name="content">
<div class="sectionindex">
<header>
<h2><a href="${_link('section_index', section)}">${title|h}</a></h2>
${feed.link(section)}
${translation_links.link(section)}
</header>
${parent.content()}
</div>
@@ -1,10 +1,10 @@
## -*- coding: utf-8 -*-
<%inherit file="list_post.tmpl"/>
<%namespace name="feed" file="feed_helper.tmpl" import="*"/>
<%namespace name="translation_links" file="translation_link_helper.tmpl" import="*"/>

<%block name="extra_head">
${parent.extra_head()}
${feed.head(tag)}
${translation_links.head(tag)}
</%block>


@@ -24,7 +24,7 @@
</ul>
%endif
<div class="metadata">
${feed.link(tag)}
${translation_links.link(tag)}
</div>
%if has_other_languages and other_languages:
<div class="translationslist translations">

0 comments on commit f2ad9b3

Please sign in to comment.