{% if list.number > 1 %}
First
{% endif %}
{% if list.has_previous and list.number != 2 %}
Previous
{% endif %}
{% for i in posts.paginator.page_range %}
{% if list.number != i %}{% endif %}{{ i }}{% if list.number != i %}{% endif %}
{% endfor %}
{% if list.has_next and list.number != list.paginator.num_pages|add:-1 %}
Next
{% endif %}
{% if list.number < list.paginator.num_pages %}
Last
{% endif %}