Jekyll - error when I have paginate in my project

I am running 3.1.2 on Windows

When I try to add 'Paginate' to my project, I get an error in cmd

Fatigue: you seem to have pagination enabled, but you don't have jekyll-paginate including the gem. Make sure you have gems: [jekyll-paginate] in the configuration file.

I have jekyll-paginate (1.1.0) and paginate (4.0.0) , and it still gives this error.

Here is my _config.yml file:

 paginate: 4 paginate_path: '/blog/page:num/' 

And my index.html page

 {% for post in paginator.posts limit: 4 %} 

What should I check to solve this problem?

+5
source share
2 answers

The Jekyll guys removed the Paginate plugin from version 3.x, as it did not play well with more basic features. You can still enable it using any of these three options.

  • In the source root directory of the site, create the _plugins directory. Put your plugins here. Any file ending with * .rb inside this directory will be uploaded before Jekyll creates your site.
  • In your _config.yml file _config.yml add a new array with the key gems and the values ​​for the plugin gems you would like to use. Example:

gems: [jekyll-coffeescript, jekyll-watch, jekyll-assets] # This will require each of these gems automatically. Then install your plugins with gem install jekyll-paginate-category jekyll-watch jekyll-assets

  1. Add the appropriate plugins to the Bundler group in the Gemfile. Example: group :jekyll_plugins do gem "my-jekyll-plugin" gem "jekyll-paginate-category" end Now you need to install all the plugins from your Bundler group by running one bundle install command

Further information on jekyll's page can be found.

+3
source

Make sure your _config.yml file has the following.

gems: [jekyll-paginate]

+1
source

Source: https://habr.com/ru/post/1243898/


All Articles