- {%- for inner in tag.pages | sort(attribute="date") %} - {%- if inner.content == page.content %} - {{ inner.title }}
- {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #} - {% else %} - {{ inner.title }}
- {%- endif %} - {%- endfor %} +
+ {%- for inner in tag.pages | sort(attribute="date") %} + {%- if inner.content == page.content %} + {{ inner.title }}
+ {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #} + {%- else %} + {{ inner.title }}
+ {%- endif %} + {%- endfor %} +
{%- if tag.page_count > num_extra_pages and num_extra_pages > 0 %} - {%- set sorted_array = tag.pages | sort(attribute="date") %} - {%- set num_pages = tag.page_count %} - - {# Shows the first page #} - {{ macros::series_link(inner=sorted_array.0, page=page, config=config) }} - - {# Hides the next couple of pages if the current section is more than 3 away from start #} - {%- if current_section_index > 3 %} -
{{ macros::translate(key="more", default="more", i18n=i18n) | title }}...
-- {%- endfor %} -
{% set _m %}{{ }}{% endset %}{{ _m | title }}...
+ + {%- endfor %} +
+ {#- Shows two pages before current page #} + {%- for inner in sorted_array[num:current_section_index] %} + {{ inner.title }}
{%- endfor %} - {# Shows the current page #} + {#- Shows the current page #} {%- if current_section_index != 0 and current_section_index != (num_pages - 1) %} - {{ macros::series_link(inner=sorted_array[current_section_index], page=page, config=config) }} + {{
- {% endfor %} + {%- endfor %} {%- if current_section_index < num_pages - 4 %}
{{ macros::translate(key="more", default="more", i18n=i18n) | title }}...
+{% set _m %}{{ }}{% endset %}{{ _m | title }}...
{%- endfor %}