-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathindex.html
executable file
·84 lines (70 loc) · 2.17 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
layout: default
---
<div class="posts">
{% for post in paginator.posts %}
<article class="post">
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
<div class="entry">
{{ post.excerpt }}
</div>
<a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
</article>
{% endfor %}
</div>
{% if paginator.total_pages > 1 %}
{% assign start = paginator.page | minus: 2 %}
{% assign end = paginator.page | plus: 2 %}
{% if start < 1 %}
{% assign start = 1 %}
{% assign end = start | plus: 4 %}
{% elsif end > paginator.total_pages %}
{% assign start = paginator.total_pages | minus: 4 %}
{% assign end = paginator.total_pages %}
{% endif %}
{% if start < 1 %}
{% assign start = 1 %}
{% endif %}
{% if end > paginator.total_pages %}
{% assign end = paginator.total_pages %}
{% endif %}
<div class="pagination-wrapper">
<div class="pagination">
{% if paginator.previous_page %}
<a class="pagination-step" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">
Newer
</a>
{% else %}
<span class="pagination-step">
Newer
</span>
{% endif %}
{% if start > 1 %}
<a class="pagination-first" href="{{ site.baseurl }}/">1</a>
<span class="pagination-more">···</span>
{% endif %}
{% for page in (start..end) %}
{% if page == paginator.page %}
<span class="active">{{ page }}</span>
{% elsif page == 1 %}
<a href="{{ site.baseurl }}/">{{ page }}</a>
{% else %}
<a href="{{ site.baseurl }}/page{{ page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if end < paginator.total_pages %}
<span class="pagination-more">···</span>
<a class="pagination-last" href="{{ site.baseurl }}/page{{ paginator.total_pages }}">{{ paginator.total_pages }}</a>
{% endif %}
{% if paginator.next_page %}
<a class="pagination-step" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">
Older
</a>
{% else %}
<span class="pagination-step">
Older
</span>
{% endif %}
</div>
</div>
{% endif %}