Fix pagination
This commit is contained in:
parent
0c5d7949a9
commit
73e6b1df5b
4 changed files with 57 additions and 55 deletions
|
@ -19,7 +19,7 @@
|
||||||
{%endif%}
|
{%endif%}
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:title" content="Revuo Monero - {{page.title}}">
|
<meta name="twitter:title" content="Revuo Monero - {{page.title}}">
|
||||||
<meta name="twitter:image" content="{{ page.image }}">
|
<meta name="twitter:image" content="https://revuo-monero.com{{ page.image }}">
|
||||||
|
|
||||||
<!-- CSS & fonts -->
|
<!-- CSS & fonts -->
|
||||||
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl | replace: '//', '/' }}">
|
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl | replace: '//', '/' }}">
|
||||||
|
|
|
@ -31,33 +31,31 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Pagination links -->
|
<!-- Pagination links -->
|
||||||
{% if paginator.total_pages > 1 %}
|
<div class="pagination">
|
||||||
<div class="pagination">
|
{% if paginator.total_pages > 1 %}
|
||||||
{% if paginator.previous_page == 1 %}
|
<div class="page-numbers"><p>
|
||||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
{% if paginator.previous_page %}
|
||||||
{% elsif paginator.previous_page%}
|
<a href="{{ paginator.previous_page_path}}" class="page-button prev">Prev</a>
|
||||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
<span class="page-item">«</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for page in (1..paginator.total_pages) %}
|
{% for page in (1..paginator.total_pages) %}
|
||||||
{% if page == paginator.page %}
|
{% assign total = paginator.total_pages %}
|
||||||
<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>
|
{% if page == paginator.page %}
|
||||||
{% else %}
|
{{ page }} of {{total}}
|
||||||
<span class="page-item">»</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if paginator.next_page %}
|
||||||
|
<a href="{{ paginator.next_page_path}}" class="page-button next">Next</a>
|
||||||
|
{% endif %}
|
||||||
|
</p></div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -32,33 +32,31 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Pagination links -->
|
<!-- Pagination links -->
|
||||||
{% if paginator.total_pages > 1 %}
|
<div class="pagination">
|
||||||
<div class="pagination">
|
{% if paginator.total_pages > 1 %}
|
||||||
{% if paginator.previous_page == 1 %}
|
<div class="page-numbers">
|
||||||
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
{% if paginator.previous_page %}
|
||||||
{% elsif paginator.previous_page%}
|
<a href="{{ paginator.previous_page_path}}" class="page-item prev">«</a>
|
||||||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="page-item">«</a>
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
<span class="page-item">«</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for page in (1..paginator.total_pages) %}
|
{% for page in (1..paginator.total_pages) %}
|
||||||
{% if page == paginator.page %}
|
{% assign total = paginator.total_pages %}
|
||||||
<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>
|
{% if page == paginator.page %}
|
||||||
{% else %}
|
<p class="page-numbers-display">{{ page }} of {{total}}</p>
|
||||||
<span class="page-item">»</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if paginator.next_page %}
|
||||||
|
<a href="{{ paginator.next_page_path}}" class="page-item next">»</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -376,3 +376,9 @@ img.dvchain {
|
||||||
.text-center {
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-numbers-display {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 1rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
Loading…
Reference in a new issue