Tweaked Jekyll on Github Page to add pagination
This blog is published on Github Pages using a Jekyll base template called Minima. It offers no built in support for pagination, so I had to do a lot of trial-and-error, and follow a lot of advice from different people on the internet. This was particular tricky, because Minima uses a home.html
template instead of an index.html
.
However, I finally achieved it by using the plugin jekyll-paginate
, and following most of the steps described here.
In summary, the steps involve:
- Invoke and configurate the plugin
jekyll-paginate
on_config.yml
. - Create the file
_includes/paginator.html
, with code that creates the links for adequate navigation. - Adjust the
index.html
file with the correct loop for the paginated posts.
Because of the particularity of Minima, I had to further:
- Rename
index.md
toindex.html
. - Correct relative paths for links called in
paginator.html
. - Adjust
home.html
to include the correct lops for the paginated posts (as one would do withindex.html
normally). - Fix styles in
_sass/minima/_layout.scss
.