Fix wrong first_page_path because of hard-coded page:num (#3778)

This commit is contained in:
yusanshi 2024-04-22 23:27:21 +08:00 committed by GitHub
parent 75841313de
commit 495fb29b45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
{% if paginator.total_pages > 1 %}
<nav class="pagination">
{% assign first_page_path = paginator.first_page_path | default: site.paginate_path | replace: 'page:num', '' | replace: '//', '/' | relative_url %}
{% assign paginate_path_last = site.paginate_path | split: '/' | last %}
{% assign first_page_path = paginator.first_page_path | default: site.paginate_path | replace: paginate_path_last, '' | replace: '//', '/' | relative_url %}
<ul>
{% comment %} Link for previous page {% endcomment %}
{% if paginator.previous_page %}