{% extends "base.html" %}

{% block page_title %}{{ tag }} · {{ config.title | default("bckt") }}{% endblock page_title %}

{% block content %}
<section class="archive-page">
  <header class="archive-header">
    <p class="eyebrow">Tag</p>
    <h1>{{ tag }}</h1>
  </header>
  <div class="content-with-rail">
    <div class="content-with-rail__main">
      <div class="post-list">
        {% set page_size = posts | length %}
        {% for post in posts %}
        {% set post_number = page_size - loop.index0 %}
        {% if post.type == "note" %}
          {% include "partials/summary-note.html" %}
        {% else %}
          {% include "partials/summary-default.html" %}
        {% endif %}
        {% else %}
        <p class="empty-state">No posts for this tag.</p>
        {% endfor %}
      </div>
      {% if pagination.prev or pagination.next %}
      <nav class="pager" aria-label="Tag pagination">
        {% if pagination.prev %}<a href="{{ base_path }}{{ pagination.prev | safe }}">Newer posts</a>{% endif %}
        {% if pagination.next %}<a href="{{ base_path }}{{ pagination.next | safe }}">Older posts</a>{% endif %}
      </nav>
      {% endif %}
    </div>
    {% include "partials/sidebar.html" %}
  </div>
</section>
{% endblock content %}
