Try to get the pagination working


#1

After I found out pagination needs to be installed additionally with jekyll 3 version, so tried to install the gem, but still could not get it work. Would be very appreciated if anyone can help.

  • Ruby version is ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

  • Jekyll version is jekyll 3.4.3

  • gems: [jekyll-paginate] is added in _config.yml

  • {%for article in paginator.posts%} is used in the code

  • Output of gem list :

      *** LOCAL GEMS ***
      addressable (2.5.1)
      bigdecimal (default: 1.3.0)
      coffee-script (2.4.1)
      coffee-script-source (1.11.1)
      colorator (1.1.0)
      did_you_mean (1.1.0)
      execjs (2.7.0)
      ffi (1.9.18)
      forwardable-extended (2.6.0)
      io-console (default: 0.4.6)
      jekyll (3.4.3)
      jekyll-coffeescript (1.0.2)
      jekyll-paginate (1.1.0)
      jekyll-paginate-category (0.1.2)
      jekyll-sass-converter (1.5.0)
      jekyll-watch (1.5.0)
      json (default: 2.0.2)
      kramdown (1.13.2)
      liquid (3.0.6)
      listen (3.0.8)
      mercenary (0.3.6)
      minitest (5.10.1)
      net-telnet (0.1.1)
      openssl (default: 2.0.3)
      pathutil (0.14.0)
      power_assert (0.4.1)
      psych (default: 2.2.2)
      public_suffix (2.0.5)
      rake (12.0.0)
      rb-fsevent (0.9.8)
      rb-inotify (0.9.8)
      rdoc (default: 5.0.0)
      rouge (1.11.1)
      safe_yaml (1.0.4)
      sass (3.4.23)
      test-unit (3.2.3)

#2

Could the square brackets be the problem? I think it should be:

gems:
- some-other-gem
- jekyll-paginate
- some-other-gem

#3

Hi David, tried it but did not work. I have updated the repository if that helps to find the issues. Live view.


#4

Ah ok, if you are running it locally then you might be able to debug it from there. Do you have an error in your command line tool?


#5

Mmm no I don’t see any errors. I have a feeling that I did not install the pagination probably that causes the problem.


#6

As per the docs it only works on index.html files, you’ve got the paginator logic in blog.html.

Try renaming it to blog/index.html and see if it works. The plugin is pretty fussy.


#7

That’s amazing, thank you so much Michael.