-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
40 lines (36 loc) · 1.35 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
---
<!-- 遍历分页后的文章 -->
{% for post in paginator.posts %}
<section>
<header>
<p>{{ post.date | date: "%b %-d, %Y" }} <a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></p>
<blockquote>{{post.excerpt}}</blockquote>
</header>
</section>
{% endfor %}
<!-- 分页链接 -->
{% if paginator.total_pages > 1 %}
<ul class="page_pagination">
{% if paginator.previous_page %}
<li class="prev"><a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a></li>
{% else %}
<li class="prev">« Prev</li>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li class="selected"><a href="javascript:;">{{ page }}</a></li>
{% elsif page == 1 %}
<li><a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a><li>
{% else %}
<li><a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a></li>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<li class="next"><a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a></li>
{% else %}
<li class="next">Next »</li>
{% endif %}
</ul>
{% endif %}