How to set paginate_path for jekyll-paginate-v2 autopages?

I’m using jekyll-paginate-v2’s autopages to generate tags and other things. The first page is written to “/tag/sometag/” as I want it to (/tag/:tag/), but the remaining pages end up in e.g. “/tag/sometag/page2/” (/tag/:tag/page:num/) but I want them in “/tag/sometag/2/” (/tag/:tag/:num/) as I have them for other collections.

I have tried setting paginate_path in various sections inside _config.yml but the plugin does not seem to care. The documentation only mentions paginate_path in backwards compatibility mode with jekyll-paginate, which I don’t think I want.

Is changing the path for autopages even possible? If so how?


Here’s the relevant part of my config. I have not included my attempts at setting paginate_path because it seems to be ignored everywhere.

pagination:
  enabled: true
  per_page: 2
  title: ':title'
  sort_field: 'date'
  sort_reverse: true
  trail:
    before: 3
    after: 3

collections:
  somecollection:
    output: true
    sort_by: date
    permalink: somecollection-:title

autopages:
  enabled: true
  collections:
    enabled: false
  tags:
    title: '#:tag'
    permalink: '/tag/:tag/'
    silent: false
    slugify:
      mode: 'pretty'
      case: true

Have you tried modifying permalink under the pagination key?

pagination:
  enabled: true
  #debug: true
  per_page: 5
  permalink: '/page/:num/'

Yes, I tried permalink in various places. In some :num isn’t properly replaced. In others :tag is not. I have looked around a bit in the plugin code and it seems to just not be supported. But I’m not fluent in ruby, so I might have overlooked something.

I currently solved this with .htaccess redirections. They look like this, in case someone finds the same issue:

RewriteRule tag/([^/]+)/([0-9]+)/?$ /tag/$1/page$2/index.html [L]