Skip to content
Snippets Groups Projects
Commit c388d4e2 authored by Augustin Lemesle's avatar Augustin Lemesle
Browse files

fix pagination

parent 4c99fd73
Branches stable/copper
Tags 0.7
No related merge requests found
Pipeline #27077 passed
...@@ -57,25 +57,33 @@ css: blog ...@@ -57,25 +57,33 @@ css: blog
</div> </div>
{% if paginator.total_pages > 1 %} {% if paginator.total_pages > 1 %}
{% if page.category %}
{% assign path = "/category/:cat/page:num.html" | replace: ":cat", page.category %}
{% assign index = "/category/:cat/index.html" | replace: ":cat", page.category %}
{% else %}
{% assign path = site.paginate_path %}
{% assign index = "/blog/index.html"%}
{% endif %}
<div class="pagination clearfix"> <div class="pagination clearfix">
{% if paginator.previous_page %} {% if paginator.previous_page %}
<a class="prev page-numbers" href="{{ paginator.previous_page_path }}">« Previous</a> <a class="prev page-numbers" href="{{ paginator.previous_page_path }}">« Previous</a>
{% if paginator.previous_page != 1 %} {% if paginator.previous_page != 1 %}
<a class='page-numbers' href="/blog/index.html">{{ 1 }}</a> <a class='page-numbers' href="{{ index }}">{{ 1 }}</a>
... ...
{% endif %} {% endif %}
{% if paginator.previous_page == 1%} {% if paginator.previous_page == 1%}
<a class='page-numbers' href="/blog/index.html">{{ 1 }}</a> <a class='page-numbers' href="{{ index }}">{{ 1 }}</a>
{% else %} {% else %}
<a class='page-numbers' href="{{ site.paginate_path | replace: ':num', paginator.previous_page }}">{{ paginator.previous_page }}</a> <a class='page-numbers' href="{{ path | replace: ':num', paginator.previous_page }}">{{ paginator.previous_page }}</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
<span class='page-numbers current'>{{ paginator.page }}</span> <span class='page-numbers current'>{{ paginator.page }}</span>
{% if paginator.next_page %} {% if paginator.next_page %}
<a class='page-numbers' href="{{ site.paginate_path | replace: ':num', paginator.next_page }}">{{ paginator.next_page }}</a> <a class='page-numbers' href="{{ path | replace: ':num', paginator.next_page }}">{{ paginator.next_page }}</a>
{% if paginator.previous_page != paginator.total_pages %} {% if paginator.next_page != paginator.total_pages %}
... ...
<a class='page-numbers' href="{{ site.paginate_path | replace: ':num', paginator.total_pages }}">{{ paginator.total_pages }}</a> <a class='page-numbers' href="{{ path | replace: ':num', paginator.total_pages }}">{{ paginator.total_pages }}</a>
{% endif %} {% endif %}
<a class="next page-numbers" href="{{ paginator.next_page_path }}">Next »</a> <a class="next page-numbers" href="{{ paginator.next_page_path }}">Next »</a>
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment