{% if limit and count %}
{% set limit = limit|int %}
{% set count = count|int %}
{% if limit < count %}
{% set pages = count // limit + (count % limit and 1 or 0) %}
{% if page != 0 %}
First
{% endif %}
{% if page > 0 %}
Previous
{% endif %}
{% for i in range(0, pages) %}
{{i+1}}
{% endfor %}
{% if page < pages-1 %}
Next
{% endif %}
{% if page != pages-1 %}
Last
{% endif %}