From c40e1756b76c5f3dd974b33c4baa720329a130bf Mon Sep 17 00:00:00 2001 From: sneg55 Date: Tue, 18 Jun 2019 16:34:18 -0700 Subject: [PATCH] paginator --- Gemfile | 1 + Gemfile.lock | 3 +++ _config.yml | 9 +++++++++ blog.md | 21 ++++++++++++++++++++- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 33a892a5..5bd964ae 100644 --- a/Gemfile +++ b/Gemfile @@ -5,3 +5,4 @@ gem 'jekyll-redirect-from', group: :jekyll_plugins gem 'jekyll-youtube', group: :jekyll_plugins gem 'jekyll-toc', group: :jekyll_plugins gem 'jekyll-sitemap', group: :jekyll_plugins +gem 'jekyll-paginate-v2', group: :jekyll_plugins diff --git a/Gemfile.lock b/Gemfile.lock index 7946e485..332226c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,6 +27,8 @@ GEM pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) + jekyll-paginate-v2 (2.1.0) + jekyll (~> 3.0) jekyll-random (0.0.3) jekyll (~> 3.3) jekyll-redirect-from (0.15.0) @@ -71,6 +73,7 @@ PLATFORMS DEPENDENCIES jekyll + jekyll-paginate-v2 jekyll-random jekyll-redirect-from jekyll-sitemap diff --git a/_config.yml b/_config.yml index 96e06193..513da557 100644 --- a/_config.yml +++ b/_config.yml @@ -20,6 +20,15 @@ toc: min_level: 1 # default: 1 max_level: 2 # default: 6 +pagination: + enabled: true + per_page: 5 + permalink: '/page/:num/' + title: ' - page :num' + limit: 0 + sort_field: 'date' + sort_reverse: true + # Build settings markdown: kramdown # Layout settings diff --git a/blog.md b/blog.md index 0d41b18a..86806d1f 100644 --- a/blog.md +++ b/blog.md @@ -2,6 +2,11 @@ layout: blog-list title: Defi Blog - What is DeFi? Interviews with DeFi projects, analytics, and important news metadescription: We want to shed some light on how DeFi products build and how the ecosystem evolves over time. Our blog features interviews with DeFi projects, analytics, and important news. +permalink: /blog/ +pagination: + enabled: true + category: blog + permalink: /:num/ ---
@@ -11,7 +16,7 @@ We want to shed some light on how DeFi products build and how the ecosystem evol
-{% for post in site.categories.blog %} +{% for post in paginator.posts %}
@@ -33,3 +38,17 @@ We want to shed some light on how DeFi products build and how the ecosystem evol {% endfor %}
+{% if paginator.total_pages > 1 %} + + {% endif %}