{% if is_paginated %}
  <nav>
    <ul class="pagination">
      {% if page_obj.has_previous %}
        <li>
          <a href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
      {% else %}
        <li class="disabled">
          <span aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </span>
        </li>
      {% endif %}
      {% for page in pages %}
          {% if page %}
              {% if page == page_obj.number %}
                  <li class="active page"><a href="#">{{ page }}</a></li>
              {% else %}
                  <li><a href="?page{{ page_suffix }}={{ page }}{{ getvars }}{{ hashtag }}" class="page">{{ page }}</a></li>
              {% endif %}
          {% else %}
              <li class="disabled"><a href="">-</a></li>
          {% endif %}
      {% endfor %}
      {% if page_obj.has_next %}
          <li>
            <a href="?page={{ page_obj.next_page_number }}" aria-label="Next">
              <span aria-hidden="true">&raquo;</span>
            </a>
          </li>
          {% else %}
            <li class="disabled">
              <span aria-label="next">
                <span aria-hidden="true">&raquo;</span>
              </span>
            </li>
          {% endif %}
    </ul>
  </nav>
{% endif %}
