<div class="text-center">
    <ul class="pagination">
        {% if pages|first > 0 %}
        <li><a href="./?p={{ pages|first }}">&laquo;</a></li>
        {% endif %}
        {% for page in pages %}
            {% if page > 0 and page <= last_page %}
            <li class="{% if current_page == page %}active{% endif %}"><a href="./?p={{ page }}">{{ page }}</a></li>
            {% endif %}
        {% endfor %}

        {% if pages|last <= last_page %}
        <li><a href="./?p={{ pages|last }}">&raquo;</a></li>
        {% endif %}
    </ul>
</div>
