-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (53 loc) · 2.27 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
layout: index
sidebar: false
sitemap: false
---
{% for post in paginator.posts %}
{% include article_index.html %}
{% endfor %}
{% if paginator.total_pages > 1 %}
<div class="pagination">
<!-- link to first page -->
{% if paginator.total_pages > 3 %}
{% if paginator.page == 1 %}
<span class="btn disabled"><i class="fa fa-angle-double-left"></i></span>
{% else %}
<a class="btn" href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-double-left"></i></a>
{% endif %}
{% endif %}
<!-- previous link -->
{% if paginator.previous_page %}
<a class="btn prev" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-left"></i></a>
{% else %}
<span class="btn disabled"><i class="fa fa-angle-left"></i></span>
{% endif %}
<!-- number links -->
{% capture start %}
{{ paginator.page | minus: 3 }}
{% endcapture %}
{% for i in (1..paginator.total_pages) limit: 5 offset: start %}
{% if i == paginator.page %}
<span class="btn disabled">{{ i }}</span>
{% elsif i == 1 %}
<a class="btn" href="{{ site.baseurl }}/">{{ i }}</a>
{% else %}
<a class="btn" href="{{ site.baseurl }}/page/{{ i }}">{{ i }}</a>
{% endif %}
{% endfor %}
<!-- next link -->
{% if paginator.next_page %}
<a class="btn next" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-right"></i></a>
{% else %}
<span class="btn disabled"><i class="fa fa-angle-right"></i></span>
{% endif %}
<!-- last page link -->
{% if paginator.total_pages > 3 %}
{% if paginator.page == paginator.total_pages %}
<span class="btn disabled"><i class="fa fa-angle-double-right"></i></span>
{% else %}
<a class="btn" href="{{ site.baseurl | replace: '//', '/' }}/page/{{paginator.total_pages}}"><i class="fa fa-angle-double-right"></i></a>
{% endif %}
{% endif %}
</div>
{% endif %}