jekyll-paginate-v2 icon indicating copy to clipboard operation
jekyll-paginate-v2 copied to clipboard

Customize autopages permalink for individual collections

Open mohkale opened this issue 4 years ago • 0 comments

We can include the name of the category in the permalink, but there's no option to change the permalink on a collection by collection basis.

For example, say I've got 2 collections languages and frameworks and I'd like to put them both under a notes permalink, such that pagination for languages goes to /notes/languages/index.md and /notes/frameworks/index.md.

That's all well and good, I can do that by setting autopages.categories.permalink to /notes/:cat/ in my _config.yml.

but now suppose I have a third collection, reviews which I don't want to go into the notes subsection. As it stands (I believe), jekyll-paginate-v2 does not give me the ability state what I want the permalink for this collection to be (distinct from the other two).

I've been getting around this by manually specifying permalinks in individual pagination pages but it'd be nice to be able to do so from my _config.yml.

For eg.

autopages:
  enabled: true

  collections:
    title: :cat | collection
    permalink: /paginated
    defaults:
      languages:
        permalink: /notes/:cat
      frameworks:
        permalink: /notes/:cat
      # not necessary, inherits default
      # from above.
      # reviews:
      #   permalink: /paginated/

mohkale avatar Mar 18 '20 15:03 mohkale