{% set items = items|default({
  "previous": {
    "href": "#",
    "text": "Previous"
  },
  "next": {
    "href": "#",
    "text": "Next"
  },
  "pages": {
    "1": {"href": "#"},
    "2": {"href": "#"},
    "3": {"href": "#"},
    "4": {"href": "#"},
    "5": {"href": "#"},
    "ellipsis": {},
    "12": {"href": "#"}
  }
}) %}
<nav aria-label="Pagination" class="pagination" role="navigation">
  <ul class="pagination__items">
    {% if items.previous %}
      <li class="pagination__previous">
        <a href="{{ items.previous.href }}" class="icon icon--arrow-left" {{ items.previous.attributes }}>{{ items.previous.text }}</a>
      </li>
    {% endif %}
    {% for key, item in items.pages %}
      {% if current|default("1") == key %}
        <li aria-current="page" class="pagination__item">{{ key }}</li>
      {% elseif key == "ellipsis" %}
        <li class="pagination__ellipsis">&hellip;</li>
      {% else %}
        <li class="pagination__item">
          <a href="{{ item.href }}" {{ item.attributes }}>{{ key }}</a>
        </li>
      {% endif %}
    {% endfor %}
    {% if items.next %}
      <li class="pagination__next">
        <a href="{{ items.next.href }}" class="icon icon--arrow-right" {{ item.next.attributes }}>{{ items.next.text }}</a>
      </li>
    {% endif %}
  </ul>
</nav>
