mirror of
https://github.com/rottenwheel/revuo-weekly.git
synced 2025-12-15 08:08:54 -05:00
Fix pagination
This commit is contained in:
parent
0c5d7949a9
commit
73e6b1df5b
4 changed files with 57 additions and 55 deletions
|
|
@ -31,33 +31,31 @@
|
|||
</main>
|
||||
|
||||
<!-- Pagination links -->
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<div class="pagination">
|
||||
{% if paginator.previous_page == 1 %}
|
||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
||||
{% elsif paginator.previous_page%}
|
||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
||||
{% else %}
|
||||
<span class="page-item">«</span>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% if page == paginator.page %}
|
||||
<span class="page-item">{{ page }}</span>
|
||||
{% elsif page == 1 %}
|
||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">{{ page }}</a>
|
||||
{% else %}
|
||||
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" class="page-item">{{ page }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">»</a>
|
||||
{% else %}
|
||||
<span class="page-item">»</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="pagination">
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<div class="page-numbers"><p>
|
||||
{% if paginator.previous_page %}
|
||||
<a href="{{ paginator.previous_page_path}}" class="page-button prev">Prev</a>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% assign total = paginator.total_pages %}
|
||||
|
||||
|
||||
{% if page == paginator.page %}
|
||||
{{ page }} of {{total}}
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path}}" class="page-button next">Next</a>
|
||||
{% endif %}
|
||||
</p></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,33 +32,31 @@
|
|||
</main>
|
||||
|
||||
<!-- Pagination links -->
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<div class="pagination">
|
||||
{% if paginator.previous_page == 1 %}
|
||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
||||
{% elsif paginator.previous_page%}
|
||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
||||
{% else %}
|
||||
<span class="page-item">«</span>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% if page == paginator.page %}
|
||||
<span class="page-item">{{ page }}</span>
|
||||
{% elsif page == 1 %}
|
||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">{{ page }}</a>
|
||||
{% else %}
|
||||
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" class="page-item">{{ page }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">»</a>
|
||||
{% else %}
|
||||
<span class="page-item">»</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="pagination">
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<div class="page-numbers">
|
||||
{% if paginator.previous_page %}
|
||||
<a href="{{ paginator.previous_page_path}}" class="page-item prev">«</a>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% assign total = paginator.total_pages %}
|
||||
|
||||
|
||||
{% if page == paginator.page %}
|
||||
<p class="page-numbers-display">{{ page }} of {{total}}</p>
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path}}" class="page-item next">»</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue