Add pagination to the blog
This commit is contained in:
parent
dd1c0df015
commit
a90f0d369e
@ -1,3 +1,5 @@
|
||||
name: Tyler Hallada - Blog
|
||||
markdown: redcarpet
|
||||
pygments: true
|
||||
paginate: 10
|
||||
paginate_path: "blog/page:num"
|
||||
|
@ -3,7 +3,7 @@ layout: default
|
||||
title: Tyler Hallada - Blog
|
||||
---
|
||||
|
||||
{% for post in site.posts %}
|
||||
{% for post in paginator.posts %}
|
||||
<div class="card">
|
||||
<div class="row clearfix post-header">
|
||||
<div class="column three-fourths">
|
||||
@ -25,3 +25,19 @@ title: Tyler Hallada - Blog
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="row clearfix pagination">
|
||||
<div class="column full">
|
||||
{% if paginator.previous_page %}
|
||||
{% if paginator.page == 2 %}
|
||||
<a href="/blog" class="previous">« Previous</a>
|
||||
{% else %}
|
||||
<a href="/blog/page{{ paginator.previous_page }}" class="previous">« Previous</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
|
||||
{% if paginator.next_page %}
|
||||
<a href="/blog/page{{ paginator.next_page }}" class="next">Next »</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -207,6 +207,11 @@ div.more-row {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
div.pagination {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
/* Posts
|
||||
|
Loading…
Reference in New Issue
Block a user