diff --git a/Gemfile b/Gemfile index c392852..3237b38 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ group :jekyll_plugins do gem "github-pages" gem "jekyll-remote-theme" gem "jekyll-feed" + gem "jekyll-paginate" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 635b8d4..969b19c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -309,6 +309,7 @@ DEPENDENCIES github-pages jekyll jekyll-feed + jekyll-paginate jekyll-remote-theme jemoji tzinfo-data diff --git a/_config.yml b/_config.yml index a759cbc..29e04c4 100644 --- a/_config.yml +++ b/_config.yml @@ -60,6 +60,7 @@ plugins: - jemoji - jekyll-feed - jekyll-sitemap + - jekyll-paginate # - jekyll-seo-tag # - jekyll-redirect-from # - jekyll-remote-theme @@ -111,3 +112,6 @@ defaults: # Set to `true` to show excerpts on the homepage. # show_excerpts: true + +paginate: 5 +paginate_path: "/blog/page:num/" diff --git a/_includes/posts.html b/_includes/posts.html index 0227d1b..6543a4a 100644 --- a/_includes/posts.html +++ b/_includes/posts.html @@ -1,8 +1,8 @@ -{% if site.paginate %} + {%- if posts.size > 0 -%} {%- if page.list_title -%} @@ -29,7 +29,7 @@

{%- endfor -%} - {% if site.paginate %} + -{%- endif -%} +{%- endif -%} diff --git a/blog.html b/blog.html new file mode 100644 index 0000000..7b6f5f1 --- /dev/null +++ b/blog.html @@ -0,0 +1,8 @@ +--- +layout: default +lang: en +title: Blog +list_title: Posts +--- + +
{%- include posts.html -%}
diff --git a/blog.md b/blog.md deleted file mode 100644 index 9caac8c..0000000 --- a/blog.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default -lang: en -title: Blog -permalink: /blog/ -list_title: Posts ---- - -
- {%- include posts.html -%} -