Section paginated page as '/2' rather than '2/index.html'

Hello there,

I have blog project. (yep I do!)
Every post belong to a section (a country) within the content/post directory.

So each section is paginated:
blog.com/canada/page/1
blog.com/canada/page/2

etc…

page 1 is compiled normally as
blog.com/canada/page/1/index.html

but all subsequent pages are compiled as
blog.com/canada/page/2 (2 here is a file named after the page number without extension containing the html of the page)

Here’s the content structure

content
└── post
    ├── canada
    │   ├── post-1.md
    │   └── post-2.md
    ├── japan
    │   ├── a-post-from-japan.md
    │   └── another-post-from-japan.md
    └── usa
           [...]

I tried with another team than mine, but the problem persisted, hence my posting it here.

Anybody see something I am missing or a known bug I was not able to spot on GitHub?
Here’s the repo if need be.

As always, thanks a ton!

You can start by setting a proper baseURL in your config. Not sure if that is it, but “/” is not supported and the behaviour is undefined.

Not sure if that is it, but “/” is not supported and the behaviour is undefined.

Will remember that. Smarty pants here thought he could get away with one config file for all environments.

In any case this does not fix the problem :frowning:

Works for me (on macOS).

It looks unstyled and ugly, though. A related tip: Use relURL (or absURL) to construct urls to static resources (CSS etc.). Then you don’t have to worry about … slashes.

It works on live server, but not on build (neither on my macOS or netlify)

Be nice! (npm install, and grunt on your local)

Thanks for the relURL tip!

I guess it is the url in the section front matter – which I guess is something new (since a few versions back). I assume it is the missing trailing slash in the URL.

I tried adding a trailing slash to it but to no avail.

I removed it and it works fine.
I can live with blog.com/post/canada as my section url…

You can create an issue on GH. It should work, but it is not at the top of my list of things to fix.

1 Like

Done, feel free to revise wording of title for something which makes more sense to you.

Thanks.