Skip to content

Commit

Permalink
Merge pull request #395 from heychirag/pagv2
Browse files Browse the repository at this point in the history
upgrade to jekyll-paginate-v2
  • Loading branch information
sergiokopplin committed Jan 21, 2020
2 parents e0d9d7e + 1f19f2a commit 85f1581
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ group :jekyll_plugins do
gem 'jekyll-gist'
gem 'jekyll-feed'
gem 'jemoji'
gem "jekyll-paginate-v2", "~> 2.0"
end
11 changes: 8 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ authors:
# normal = 560px / large = 810px
width: normal

# if you don't need pagination, comment the *paginate* configs below
# paginate: 5
# paginate_path: "blog/:num/"
# if you do/don't need pagination, toggle 'enabled' between true/false below
pagination:
enabled: false
sort_reverse: true # display recent posts first
title: ':title' # Changing this will mess up the header display logic
per_page: 5
permalink: "/:num/" # pagination link that will be appended

# if you don't need projects, comment the *projects* configs below
projects: true
Expand Down Expand Up @@ -117,6 +121,7 @@ plugins:
- jekyll-feed
- jemoji
- jekyll-admin
- jekyll-paginate-v2

jekyll-mentions:
base_url: https://github.com
Expand Down
4 changes: 3 additions & 1 deletion blog/index.html → blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# https://jekyllrb.com/docs/pagination/
layout: page
title: Blog
pagination:
enabled: true
---
<section class="list">
{% if site.posts.size == 0 %}
<p class="text-center">Nothing published yet!</p>
{% elsif site.paginate %}
{% elsif site.pagination.enabled %}
{% for post in paginator.posts %}
{% if post.category == 'blog' %}
{% if post.hidden != true %}
Expand Down

0 comments on commit 85f1581

Please sign in to comment.