forked from github/pelican
List of translations for simple and notmyidea pages
This commit is contained in:
parent
67c576add6
commit
429991c3f9
6 changed files with 20 additions and 1 deletions
|
|
@ -5,6 +5,8 @@
|
|||
<h2 class="entry-title">
|
||||
<a href="{{ article.url }}" rel="bookmark"
|
||||
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(article) }}
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="{{ article.date.isoformat() }}">
|
||||
|
|
|
|||
|
|
@ -2,5 +2,8 @@
|
|||
{% block title %}{{ page.title }}{%endblock%}
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(page) }}
|
||||
|
||||
{{ page.content }}
|
||||
{% endblock %}
|
||||
|
|
|
|||
9
pelican/themes/simple/templates/translations.html
Normal file
9
pelican/themes/simple/templates/translations.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% macro translations_for(article) %}
|
||||
{% if article.translations %}
|
||||
Translations:
|
||||
{% for translation in article.translations %}
|
||||
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue