mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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
|
|
@ -10,5 +10,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>In <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
|
<p>In <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
|
||||||
{% include 'taglist.html' %}
|
{% include 'taglist.html' %}
|
||||||
{% include 'translations.html' %}
|
{% import 'translations.html' as translations with context %}
|
||||||
|
{{ translations.translations_for(article) }}
|
||||||
</footer><!-- /.post-info -->
|
</footer><!-- /.post-info -->
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section id="content" class="body">
|
<section id="content" class="body">
|
||||||
<h1 class="entry-title">{{ page.title }}</h1>
|
<h1 class="entry-title">{{ page.title }}</h1>
|
||||||
|
{% import 'translations.html' as translations with context %}
|
||||||
|
{{ translations.translations_for(page) }}
|
||||||
{% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">get
|
{% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">get
|
||||||
the pdf</a>{% endif %}
|
the pdf</a>{% endif %}
|
||||||
{{ page.content }}
|
{{ page.content }}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
{% macro translations_for(article) %}
|
||||||
{% if article.translations %}
|
{% if article.translations %}
|
||||||
Translations:
|
Translations:
|
||||||
{% for translation in article.translations %}
|
{% for translation in article.translations %}
|
||||||
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
|
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
<h2 class="entry-title">
|
<h2 class="entry-title">
|
||||||
<a href="{{ article.url }}" rel="bookmark"
|
<a href="{{ article.url }}" rel="bookmark"
|
||||||
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
|
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
|
||||||
|
{% import 'translations.html' as translations with context %}
|
||||||
|
{{ translations.translations_for(article) }}
|
||||||
</header>
|
</header>
|
||||||
<footer class="post-info">
|
<footer class="post-info">
|
||||||
<abbr class="published" title="{{ article.date.isoformat() }}">
|
<abbr class="published" title="{{ article.date.isoformat() }}">
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,8 @@
|
||||||
{% block title %}{{ page.title }}{%endblock%}
|
{% block title %}{{ page.title }}{%endblock%}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
|
{% import 'translations.html' as translations with context %}
|
||||||
|
{{ translations.translations_for(page) }}
|
||||||
|
|
||||||
{{ page.content }}
|
{{ page.content }}
|
||||||
{% endblock %}
|
{% 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