Skip to content

Commit 57f6d6e

Browse files
authored
Fix incorrect link on penultimate page button (#210)
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.
1 parent 086f54c commit 57f6d6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/macros/macros.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ <h1><a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}
361361

362362
{%- if paginator.number_pagers > paginator.current_index+5 and paginator.number_pagers > 7 %}
363363
<span class="dis outp">...</span>
364-
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
364+
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
365365
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
366366
{%- elif paginator.number_pagers > paginator.current_index+4 and paginator.number_pagers > 7 %}
367-
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-2}}</a>
368-
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
367+
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-2}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-2}}</a>
368+
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
369369
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
370370
{%- elif paginator.number_pagers > paginator.current_index+3 and paginator.number_pagers > 6 %}
371-
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers-1}}</a>
371+
<a class="inp on" href="{{ paginator.base_url | safe }}{{paginator.number_pagers-1}}/{%- if uglyurls %}index.html{%- endif %}">{{paginator.number_pagers-1}}</a>
372372
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>
373373
{%- elif paginator.number_pagers > paginator.current_index+2 and paginator.number_pagers > 5 %}
374374
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">{{paginator.number_pagers}}</a>

0 commit comments

Comments
 (0)