Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (27 sloc) 1.25 KB
{% macro render_pagination(pagination) %}
<div class="btn-group" role="group" aria-label="pagination">
{% if pagination.page > 1 %}
<a href="/blog" class="btn btn-secondary-nord">&laquo;</a>
{% else %}
<a href="/blog" class="btn btn-secondary-nord disabled">&laquo;</a>
{% endif %}
{% if pagination.page - 2 > 1 %}
<a href="/blog/page/{{ pagination.page - 2 }}/" class="btn btn-secondary-nord">{{ pagination.page - 2 }}</a>
{% endif %}
{% if pagination.has_prev %}
<a href="{{ pagination.prev|url }}" class="btn btn-secondary-nord">{{ pagination.page - 1 }}</a>
{% endif %}
<span class="btn btn-secondary-nord disabled">{{ pagination.page }}</span>
{% if pagination.has_next %}
<a href="{{ pagination.next|url }}" class="btn btn-secondary-nord">{{ pagination.page + 1 }}</a>
{% endif %}
{% if pagination.page + 2 < pagination.pages %}
<a href="/blog/page/{{ pagination.page + 2 }}/" class="btn btn-secondary-nord">{{ pagination.page + 2 }}</a>
{% endif %}
{% if pagination.page == pagination.pages %}
<a href="/blog/page/{{ pagination.pages }}" class="btn btn-secondary-nord disabled">&raquo;</a>
{% else %}
<a href="/blog/page/{{ pagination.pages }}" class="btn btn-secondary-nord">&raquo;</a>
{% endif %}
</div>
{% endmacro %}
You can’t perform that action at this time.