_includes/post-paginator.html in jekyll-theme-chirpy-5.6.1 vs _includes/post-paginator.html in jekyll-theme-chirpy-6.0.0
- old
+ new
@@ -1,15 +1,13 @@
-<!--
- The paginator for post list on HomgPage.
--->
+<!-- The paginator for post list on HomgPage. -->
-<ul class="pagination align-items-center mt-4 pl-lg-2">
+<ul class="pagination align-items-center my-4 ps-lg-2">
<!-- left arrow -->
{% if paginator.previous_page %}
{% assign prev_url = paginator.previous_page_path | relative_url %}
{% else %}
- {% assign prev_url = "#" %}
+ {% assign prev_url = '#' %}
{% endif %}
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
<i class="fas fa-angle-left"></i>
@@ -19,11 +17,10 @@
<!-- page numbers -->
{% assign left_ellipsis = false %}
{% assign right_ellipsis = false %}
{% for i in (1..paginator.total_pages) %}
-
{% assign pre = paginator.page | minus: 1 %}
{% assign next = paginator.page | plus: 1 %}
{% assign pre_less = pre | minus: 1 %}
{% assign next_more = next | plus: 1 %}
{% assign show = false %}
@@ -35,21 +32,26 @@
{% elsif paginator.page == paginator.total_pages %}
{% if i == 1 or i >= pre_less %}
{% assign show = true %}
{% endif %}
{% else %}
- {% if i == 1 or i == paginator.total_pages%}
+ {% if i == 1 or i == paginator.total_pages %}
{% assign show = true %}
{% elsif i >= pre and i <= next %}
{% assign show = true %}
{% endif %}
{% endif %}
{% if show %}
<!-- show number -->
<li class="page-item {% if i == paginator.page %} active{% endif %}">
- <a class="page-link btn-box-shadow" href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}">{{ i }}</a>
+ <a
+ class="page-link btn-box-shadow"
+ href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}"
+ >
+ {{- i -}}
+ </a>
</li>
{% else %}
<!-- hide number -->
{% if i < pre and left_ellipsis == false %}
<li class="page-item disabled">
@@ -61,11 +63,10 @@
<span class="page-link btn-box-shadow">...</span>
</li>
{% assign right_ellipsis = true %}
{% endif %}
{% endif %}
-
{% endfor %}
<!-- mobile pagination -->
<li class="page-index align-middle">
<span>{{ paginator.page }}</span>
@@ -74,15 +75,15 @@
<!-- right arrow -->
{% if paginator.next_page_path %}
{% assign next_url = paginator.next_page_path | relative_url %}
{% else %}
- {% assign next_url = "#" %}
+ {% assign next_url = '#' %}
{% endif %}
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
<i class="fas fa-angle-right"></i>
</a>
</li>
-
-</ul> <!-- .pagination -->
+</ul>
+<!-- .pagination -->