diff --git a/templates/_includes/translations.html b/templates/_includes/translations.html index 473bf1fb..1646eee3 100644 --- a/templates/_includes/translations.html +++ b/templates/_includes/translations.html @@ -1,3 +1,11 @@ +{% macro entry_hreflang(entry) %} +{% if entry.translations %} + {% for translation in entry.translations %} + + {% endfor %} +{% endif %} +{% endmacro %} + {% macro translations_for(article) %} {% if article.translations %}

diff --git a/templates/article.html b/templates/article.html index e2cc0097..1256cc09 100644 --- a/templates/article.html +++ b/templates/article.html @@ -26,6 +26,11 @@ {% block head_links %} {{ super() }} {% include '_includes/photos_header.html' %} + +{% import 'translations.html' as translations with context %} +{% if translations.entry_hreflang(article) %} + {{ translations.entry_hreflang(article) }} +{% endif %} {% endblock head_links %} {% block content %} diff --git a/templates/page.html b/templates/page.html index 95dfca12..1f3de200 100644 --- a/templates/page.html +++ b/templates/page.html @@ -20,6 +20,14 @@ {{ smo_metadata(page) }} {% endblock meta_tags_in_head %} +{% block head_links %} +{{ super() }} +{% import 'translations.html' as translations with context %} +{% if translations.entry_hreflang(page) %} + {{ translations.entry_hreflang(page) }} +{% endif %} +{% endblock head_links %} + {% block content %}

@@ -41,6 +49,8 @@

Contents

{% endif %} + {% import '_includes/translations.html' as translations with context %} + {{ translations.translations_for(page) }} {{ page.content }} {% from '_includes/comments.html' import comments_section with context %} {{ comments_section(page) }}