{% if show_first_last %}
  • ««
  • {% endif %} {% if show_prev_next %}
  • «
  • {% endif %} {% set start_page = [1, current_page - (max_links // 2)]|max %} {% set end_page = [total_pages, start_page + max_links - 1]|min %} {% set start_page = [1, end_page - max_links + 1]|max %} {% for page in range(start_page, end_page + 1) %}
  • {{ page }}
  • {% endfor %} {% if show_prev_next %}
  • »
  • {% endif %} {% if show_first_last %}
  • »»
  • {% endif %}