Skip to content

Commit 46b2405

Browse files
committed
page
1 parent a806de3 commit 46b2405

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ exclude:
7373
- Gemfile.lock
7474
- LICENSE
7575
- README.md
76+
paginate: 3
77+
paginate_path: "page/:num"

index.html

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@
22
layout: default
33
---
44

5-
{% for post in site.posts %}
5+
{% for post in paginator.posts %}
66
<section>
77
<article id="post-{{ post.wordpress_id }}" class="post-{{ post.wordpress_id }} post type-post status-publish format-standard hentry category-other tag-101 tag-1003 tag-32">
88
<h1 class="post-title"><a href="{{ post.link }}">{{ post.title }}</a></h1>
99
{{ post.content | truncatewords:40}}
1010
</article>
1111
</section>
12-
{% endfor %}
12+
{% endfor %}
13+
<section>
14+
<aside>
15+
<nav id="nav-below" class="navigation" role="navigation">
16+
<div class="nav-previous">
17+
{% if paginator.next_page %}
18+
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}"><span class="meta-nav"></span> 早期文章</a>
19+
{% endif %}
20+
</div>
21+
22+
<div class="nav-next">
23+
{% if paginator.previous_page %}
24+
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">较新文章 <span class="meta-nav"></span></a>
25+
{% endif %}
26+
</div>
27+
</nav>
28+
</aside>
29+
</section>

0 commit comments

Comments
 (0)