forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request barryclark#6 from siddhantjain/gh-pages
Adding pagination in blog posts list
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,18 @@ email: [email protected] | |
|
||
exclude: [README.md, Gemfile, Gemfile.lock, node_modules, gulpfile.js, package.json, _site, src, vendor] | ||
|
||
#pagination | ||
paginate: 5 | ||
paginate_path: "blog/page:num/" | ||
|
||
gems: | ||
- jemoji | ||
- jekyll-mentions | ||
- jekyll-seo-tag | ||
- jekyll-feed | ||
- jekyll-sitemap | ||
- jekyll-gist | ||
- jekyll-paginate | ||
|
||
jekyll-mentions: | ||
base_url: https://github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="pagination"> | ||
{% if paginator.previous_page %} | ||
<a href="{{ paginator.previous_page_path }}" class="previous">Previous</a> | ||
{% else %} | ||
<span class="previous">Previous</span> | ||
{% endif %} | ||
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span> | ||
{% if paginator.next_page %} | ||
<a href="{{ paginator.next_page_path }}" class="next">Next</a> | ||
{% else %} | ||
<span class="next ">Next</span> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
--- | ||
layout: default | ||
permalink: /blog/index.html | ||
title: Blog | ||
--- | ||
{% include header.html %} | ||
|
||
<section class="home__sections"> | ||
{% for post in site.posts %} | ||
{% for post in paginator.posts %} | ||
<div class="home__sections-single {% if post.star == true %}star{% endif %}"> | ||
<a href="{{ site.url }}{{ post.url }}"> | ||
<aside><time datetime="{{ post.date | date:"%d-%m-%Y" }}">{{ post.date | date: "%b %d %Y" }}</time></aside> | ||
<h3>{{ post.title }}</h3> | ||
</a> | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
{% include pagination.html%} | ||
</section> | ||
|
||
{% include footer.html %} | ||
{% include footer.html %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: blog | ||
title: Blog | ||
--- | ||
##Blog |