{% extends "index.html" %}

{% block main_content %}

{%- set title = macros_translate::translate(key="all_tags", default="All tags", language_strings=language_strings) -%}

{{ macros_page_header::page_header(title=title)}}

<div class="tag-cloud">
    <ul class="tags">
        {%- for term in terms -%}
            <li class="tags-item"><a href="{{ term.permalink | safe }}">
                {{ term.name }}</a>
                – {{ term.pages | length }}{%- if term.pages | length == 1 %}
                {# Only one post. Singular. #}
                    {{- macros_translate::translate(key="post", default="post", language_strings=language_strings) -}}
                {% elif term.pages | length > 1 %}
                {# More than one post per tag. Plural. #}
                    {{- macros_translate::translate(key="posts", default="posts", language_strings=language_strings) -}}
                {%- endif -%}
            </li>
        {%- endfor -%}
    </ul>
</div>

{% endblock main_content %}
