{% extends 'public/base.html' %}

{% block title %}{{ pt('all_tags') }} - {{ site_name }}{% endblock %}
{% block meta_description %}{{ pt('all_tags_desc') }} - {{ site_name }}{% endblock %}

{% block schema %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CollectionPage",
  "name": "{{ pt('all_tags') }}",
  "url": "{{ request.url }}",
  "description": "{{ pt('all_tags_desc') }}"
}
</script>
{% endblock %}

{% block content %}
<div class="ap-page__header ap-page__header--centered">
    <h1 class="ap-page__title">{{ pt('all_tags') }}</h1>
    <p class="ap-page__subtitle">{{ pt('all_tags_desc') }}</p>
</div>

{% if tags %}
<div class="ap-hub-grid">
    {% for tag_name, count in tags %}
    <a href="{{ url_for('view_tag', tag_name=tag_name) }}" class="ap-hub-card">
        <span class="ap-hub-card__name">{{ tag_name }}</span>
        <span class="ap-hub-card__count">{{ count }} {{ pt('post_singular') if count == 1 else pt('posts_plural') }}</span>
    </a>
    {% endfor %}
</div>
{% else %}
<div class="ap-empty-state">
    <p>{{ pt('no_tags') }}</p>
</div>
{% endif %}
{% endblock %}
