fix: remove 'index.html' in pagination (#2509)

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.
This commit is contained in:
Andrew Boyer 2024-06-15 20:31:40 +01:00 committed by GitHub
parent 1a7fddecf8
commit be52a965e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@
{% if paginator.page_trail %} {% if paginator.page_trail %}
{% for trail in paginator.page_trail %} {% for trail in paginator.page_trail %}
<li class="page-item {% if page.url == trail.path %}active{% endif %}"> <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> </li>
{% endfor %} {% endfor %}
{% endif %} {% endif %}