-
Notifications
You must be signed in to change notification settings - Fork 91
/
index.html
40 lines (36 loc) · 1.92 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
layout: default
---
<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
{% include post.html post=post content=post.content %}
{% endfor %}
{% if paginator.total_pages > 1 %}
<ul class="pagination">
<li class="pagination-item">
<a class="pagination-link pagination-link--non-numeric" {% if paginator.page == 1 %}disabled="disabled"{% endif %} href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">← First page</a>
</li>
<li class="pagination-item">
<a class="pagination-link pagination-link--non-numeric" {% if paginator.previous_page == nil %}disabled="disabled"{% endif %} href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">← Prev</a>
</li>
<!-- Numbers -->
{% for page in (1..paginator.total_pages) %}
<li class="pagination-item">
{% if page == paginator.page %}
<a class="pagination-link pagination-link--selected" href="#">{{ page }}</a>
{% elsif page == 1 %}
<a class="pagination-link" href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
{% else %}
<a class="pagination-link" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
</li>
{% endfor %}
<!-- End of numbers -->
<li class="pagination-item">
<a class="pagination-link pagination-link--non-numeric" {% if paginator.next_page == nil %}disabled="disabled"{% endif %} href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next →</a>
</li>
<li class="pagination-item">
<a class="pagination-link pagination-link--non-numeric" {% if paginator.page == paginator.total_pages %}disabled="disabled"{% endif %} href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', paginator.total_pages }}">Last page →</a>
</li>
</ul>
{% endif %}