MCT-master / mct-master.github.io

The blog of MCT
https://mct-master.github.io
14 stars 9 forks source link

Pagination of categories #13

Open stefanofasciani opened 4 years ago

stefanofasciani commented 4 years ago

The number of posts in many categories is getting quite large. The page may result heavy to load (many images, some not really of the ideal size), and difficult to browse (never-ending scroll down).

Github pages supports jekyll-paginate https://jekyllrb.com/docs/pagination/ , which I used to paginate the homepage (latest posts). In _config.yml it is possible to set the number of posts per page.

However jekyll-paginate does not support multiple pagination or pagination of categories. Instead jekyll-paginate-v2 https://rubygems.org/gems/jekyll-paginate-v2/versions/2.0.0 supports pagination of categories and tags, but the v2 is not yet supported by Girhub pages. https://pages.github.com/versions/

I tried to build the blog with jekyll-paginate-v2 locally and I managed to split in pages also the categories (messy but it worked). We should wait until Github Pages upgrade the pagination plugin and then paginate all category pages (this requires changing the associated pages from .md to .html).