blob: 2a83aa780dd812eab794f964e6ecd66727520c9a (
plain) (
tree)
|
|
<!-- Takes a content (page, article,...) and translate it if possible-->
{% macro translate(content, sub_destination=None) -%}
{% if content.translations %}
Also available in:
{% for translation in content.translations %}
{% if sub_destination %}
{% if sub_destination.endswith('/') %}
sub_destination = sub_destination[:-1]
{% endif %}
<a href="{{ SITEURL }}/{{ sub_destination }}/{{ translation.url }}">{{ translation.lang }}</a>
{% else %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
{% endif %}
{% endfor %}
{% endif %}
{%- endmacro %}
|