Skip to content

Commit 35e4391

Browse files
committed
Add _include/pagination.html but not using that yet
1 parent 875ecc5 commit 35e4391

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

_includes/pagination.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--<div class="pagination loop-pagination"><span class="page-numbers current">1</span>
2+
<a class="page-numbers" href="http://demo.alienwp.com/origin/page/2/">2</a>
3+
<a class="next page-numbers" href="http://demo.alienwp.com/origin/page/2/">Next →</a></div>-->
4+
5+
<div id="post-pagination" class="pagination loop-pagination">
6+
{% if paginator.previous_page %}
7+
{% if paginator.previous_page == 1 %}
8+
<a class="prev page-numbers" href="/blog">Previous</a>
9+
{% else %}
10+
<a class="prev page-numbers" href="/blog/page{{paginator.previous_page}}">Previous</a>
11+
{% endif %}
12+
{% endif %}
13+
14+
15+
{% if paginator.page == 1 %}
16+
<span class="page-numbers current">1</span>
17+
{% else %}
18+
<a class="page-numbers" href="/blog">1</a>
19+
{% endif %}
20+
21+
{% for count in (2..paginator.total_pages) %}
22+
{% if count == paginator.page %}
23+
<span class="page-numbers current">{{count}}</span>
24+
{% else %}
25+
<a class="page-numbers" href="/blog/page{{count}}">{{count}}</a>
26+
{% endif %}
27+
{% endfor %}
28+
29+
{% if paginator.next_page %}
30+
<a class="next page-numbers" href="/blog/page{{paginator.next_page}}">Next</a>
31+
{% endif %}
32+
</div>

blog/index.html

-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
<div id="content">
99
<div class="hfeed">
10-
1110
{% for post in site.posts %}
1211
<div class="hentry post">
1312
<div class="sticky-header">
@@ -21,10 +20,6 @@ <h2 class="entry-title"><a href="{{ post.url }}" title="{{ post.title }}" rel="b
2120
</div>
2221
{% endfor %}
2322
</div><!-- .hfeed -->
24-
25-
<!--<div class="pagination loop-pagination"><span class="page-numbers current">1</span>
26-
<a class="page-numbers" href="http://demo.alienwp.com/origin/page/2/">2</a>
27-
<a class="next page-numbers" href="http://demo.alienwp.com/origin/page/2/">Next →</a></div>-->
2823
</div><!-- #content -->
2924

3025
{% include sidebar.html %}

0 commit comments

Comments
 (0)