---
layout: base.njk
---

<section class="blogpost">
  <h1>{{ title }}</h1>

  <p>Everything I have written, from newest to oldest.</p>
</section>

{{ content | safe }}

{% if pagination.pages.length > 1 %}
  <nav>
    <ol class="pagination">
      <li>
        {% if page.url != pagination.href.first %}
          <a href="{{ pagination.href.first }}">{% lucide "chevron-first" %}</a>
        {% else %}
          <span>{% lucide "chevron-first" %}</span>
        {% endif %}
      </li>
      <li>
        {% if pagination.href.previous %}
          <a href="{{ pagination.href.previous }}">{% lucide "chevron-left" %}</a>
        {% else %}
          <span>{% lucide "chevron-left" %}</span>
        {% endif %}
      </li>
      {%- for pageEntry in pagination.pages %}
        <li>
          <a
            href="{{ pagination.hrefs[ loop.index0 ] }}"
            {% if page.url == pagination.hrefs[ loop.index0 ] %}
              aria-current="page"
            {% endif %}
          >
            {{ loop.index }}
          </a>
        </li>
      {%- endfor %}
      <li>
        {% if pagination.href.next %}
          <a href="{{ pagination.href.next }}">{% lucide "chevron-right" %}</a>
        {% else %}
          <span>{% lucide "chevron-right" %}</span>
        {% endif %}
      </li>
      <li>
        {% if page.url != pagination.href.last %}
          <a href="{{ pagination.href.last }}">{% lucide "chevron-last" %}</a>
        {% else %}
          <span>{% lucide "chevron-last" %}</span>
        {% endif %}
      </li>
    </ol>
  </nav>
{% endif %}
