mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.48k stars 25.74k forks source link

Enhance theme to fully support jekyll-paginate-v2 plugin #1307

Closed jaybe-jekyll closed 5 years ago

jaybe-jekyll commented 7 years ago

Feature request to add support for:


Notes:

  1. The minimal-mistakes-jekyll gem has an _includes/paginator.html include which gets included to produce the paging navigation and [lovely] UI. See the theme's _layouts/home.html layout for the calling.

    • The include refers to site.pagination_path to build the [proper] reference links to navigate between pages.
    • Note site.pagination_path refers to jekyll-paginate (version 1), not v2. Ergo, out of box, minimal-mistakes-jekyll gem is not designed to be compatible with jekyll-pagination-v2.
    • For example, if you try to use pagination outside of root path/URI / breakage will occur with pagination... unless adaptation to _includes/paginator.html has been accommodated.
    • e.g. ...{{ page.pagination.mypaginator_path | replace: ':cat', page.autopages.display_name | replace: 'page:num', '' | replace: '//', '/' | absolute_url %}}...
  2. The default _config.yml for minimal-mistakes-jekyll theme/gem does not contain configuration for jekyll-paginate-v2, which requires new/additional/different configuration to enable... both in _config.yml and then within the pages where you desire pagination, e.g.:

I was eventually able to integrate and implement:

It required addressing the aforementioned aspects however, which meant having the following files and adjusted outside of the minimal-mistakes-jekyll gem theme:

Would very much like to see jekyll-paginate-v2 integration and capabilities without the need to maintain and manage core theme files within the site/source. Wonderful theme and offering! Thank you @mmistakes!

re: #1240 re: #issuecomment-337258095

jaybe-jekyll commented 7 years ago

related: https://github.com/jekyll/jekyll/issues/6391

"Issues with hard coded checks for the decommissioned pagination gem in the main jekyll source #6391"

douglangille commented 7 years ago

This is what I did to get it to work on https://douglangille.ca with the gem'd theme:

https://github.com/douglangille/douglangille/blob/master/_config.yml https://github.com/douglangille/douglangille/blob/master/_includes/paginator.html https://github.com/douglangille/douglangille/blob/master/_layouts/autopage.html

As mentioned elsewhere, moving from jekyll-paginate to jekyll-paginate-v2 will remove the need for jekyll-archives. There will need to be some cleanup in a few places to fix that up. Right now, I have to leave references to jekyll-archives in _config.yml because I'm lazy.

I like @mmistakes' hand-rolled trailpath in paginator.html and I had to hack at it to get it to work with jekyll-paginate-v2. Moving to the new gem's trailpath functionality is ultimately cleaner tho.

erickguan commented 6 years ago

If @mmistakes wants to support github-pages then jekyll-paginate-v2 is not really an option since it's not included in the gem yet. That's why I didn't update that in #1388.

mmistakes commented 6 years ago

I'd be up for rolling in support for the superior jekyll-paginate-v2 plugin if/when it gets allowed on GitHub Pages. Same for its autopages feature.

I use both on my personal site, but not sure if there is a way to do them now and give the user a choice of falling back to the whitelisted gems. I sort of do that with Jekyll Archives support, but it's kind of messy and makes configuring confusing, especially for those not familiar with Jekyll.

johnlane commented 6 years ago

For anyone looking to implement jekyll-paginate-v2 now, coming here to find the links from @douglangille are dead, there is a compatible version of _includes/paginator.html here. I found that it offers the same behaviour as the theme's support for the default paginator.

Alternatively please read the blog post by @mmistakes.

@mmistakes you mention that you use jekyll-paginate-v2 on your own site - if your config is better (or more robust, or whatever) than that what I linked to then would you mind sharing a gist that we might use until the theme catches up? (great theme, by the way!!!)

mmistakes commented 6 years ago

@johnlane I use jekyll-paginate-v2 on my own site but that's a completely different theme from Minimal Mistakes. So the config settings is likely not 1:1. I'm also using the plugin's Autopage feature to generate tag archives.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.

iBug commented 5 years ago

Can we get some insights on this? Paginate V2 is AWESOME and I'm trying to patch MM to adapt it for my site.

If needed, I can provide assistance or even fire up a PR for this.

luispuerto commented 5 years ago

@iBug I would love to have paginate-v2 support! since I would like to be able to paginate paginate my jekyll archives, but I think that theme-wise we shouldn't drop compatibility with jekyll-paginate. Not everyone wants to build outside gh-pages