Skip to content

Commit

Permalink
Fix incorrect link on penultimate page button (#210)
Browse files Browse the repository at this point in the history
Before this change, if you click the second-last page number on a site
with lots of pages, the link would take you to the last page.

After this change, the link correctly points at the second-last page,
matching the label on the button.
  • Loading branch information
andybalaam authored Oct 19, 2024
1 parent 086f54c commit 57f6d6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/macros/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,14 @@ <h1><a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}

{%- if paginator.number_pagers > paginator.current_index+5 and paginator.number_pagers > 7 %}
<span class="dis outp">...</span>
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
{%- elif paginator.number_pagers > paginator.current_index+4 and paginator.number_pagers > 7 %}
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-2}}</a>
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-2}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-2}}</a>
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
{%- elif paginator.number_pagers > paginator.current_index+3 and paginator.number_pagers > 6 %}
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
{%- elif paginator.number_pagers > paginator.current_index+2 and paginator.number_pagers > 5 %}
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
Expand Down

0 comments on commit 57f6d6e

Please sign in to comment.