{% endif %}
{% endfor %}
{% endif %}
{% if article.tags %}
{% set article_tags = [] %}
{% for tag, articles in tags %}
{% for t in article.tags %}
{% if tag.url == t.url %}
{% if article_tags.append({'name': tag.name, 'url': tag.url, 'articles': articles|length()}) %}{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{# Sort by tag frequency, then alphabetically #}
{% for tag in article_tags|sort(attribute='name')|sort(reverse=True, attribute='articles') %}
{% endif %}
{% if article.prev_article or article.next_article %}
{% endif %}
{% endblock right_sidebar %}
{% block content %}
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
{{ article.content }}
{# Fetch content related to the current article from either related-posts
or simila-posts plugin. The latter teakes precedence as it produces more
robust results. #}
{% set related = None %}
{% if article.similar_posts %}
{% set related = article.similar_posts %}
{% elif article.related_posts %}
{% set related = article.related_posts %}
{% endif %}
{% if related %}
Related content
{# TODO: Use fancier related layout with images, as in:
https://kevin.deldycke.com/2012/04/beautify-contextual-related-posts-wordpress-plugin/ #}