Pelican – Improved Display of Translations
This article is about Pelican1, a static site generator, and about customising it's theme.
A few days ago I received a e-mail asking me about the theme of this blog and especially how it handles translations of articles:
If there are no translations:
If there are translations:
Pelican it self already supports translations and a simple method to select the language:
1 2 3 4 | <!-- Jinja Theme -->
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
{% endfor %}
|
The problem with this snippet is that it only outputs country codes (en
, de
, …) instead of full language …