Skip to content

Commit

Permalink
fix: remove 'index.html' in pagination (alshedivat#2509)
Browse files Browse the repository at this point in the history
Currently, on the [blog](https://alshedivat.github.io/al-folio/blog/)
page, clicking "older" and "newer" on the pagination at the bottom
direct you forward to links like `/al-folio/blog/page/2/` and backward
to `/al-folio/blog/`.

However, if you click on the `1`, `2`.. etc buttons, there is a
different behavior. The links now contain an `index.html`. For example,
clicking `2` leads you to `/al-folio/blog/page/2/index.html`. It is the
same content, just with a messier hyper link. Same with clicking `1`,
you are brought to `/al-folio/blog/`.

This fix creates a consistency among the hyper links in pagination.
  • Loading branch information
asboyer authored Jun 15, 2024
1 parent 1a7fdde commit be52a96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _includes/pagination.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if paginator.page_trail %}
{% for trail in paginator.page_trail %}
<li class="page-item {% if page.url == trail.path %}active{% endif %}">
<a class="page-link" href="{{ trail.path | relative_url }}" title="{{trail.title}}">{{ trail.num }}</a>
<a class="page-link" href="{{ trail.path | relative_url | remove: 'index.html' }}" title="{{trail.title}}">{{ trail.num }}</a>
</li>
{% endfor %}
{% endif %}
Expand Down

0 comments on commit be52a96

Please sign in to comment.