Customizing pagination URLs with custom templating

Right now no matter what I do, the PaginatePath variable creates output like this:

  • {{PaginatePath}}/2/
  • {{PaginatePath}}/3/

This results in URLs like /page/2/.

However I want to be able to control both the prefix and the suffix and have something like:

PaginatePathTemplate: index{{.Page}}.html

so that I can have URLs like:

  • index2.html
  • index3.html

Is this possible today (unless I’m missing) or is it a feature request (which I might be happy to implement)?

(The reason I’m asking this is because I’m migrating from another CMS that creates pagination output files like this, and I don’t want to break the URLs.)

You can currently only control the value of page via the paginatepath config option.