{% if posts.lastPage > 1 %}
<ul class="pagination">
    {% if posts.currentPage > 1 %}
    <li><a href="{{ this.page.baseFileName|page({ (pageParam): (posts.currentPage-1) }) }}">{{ '&larr; Prev'|_ }}</a>
    </li>
    {% endif %}

    {% for page in 1..posts.lastPage %}
    <li class="{{ posts.currentPage == page ? 'active' : null }}">
        <a href="{{ this.page.baseFileName|page({ (pageParam): page }) }}">{{ page }}</a>
    </li>
    {% endfor %}

    {% if posts.lastPage > posts.currentPage %}
    <li><a href="{{ this.page.baseFileName|page({ (pageParam): (posts.currentPage+1) }) }}">{{ 'Next &rarr;'|_ }}</a>
    </li>
    {% endif %}
</ul>
{% endif %}