This works great for top level files so content/pages/about.md or content/pages/page1.md. It seems to stop working for subdirectories / subfolders and I end up having to add pages to the URL for subfolders. For example of if I’ve got content/pages/dir1/file.md I’d expect the URL to end up being /dir1/file/ with the permalink config I’ve got but it’s actually ending up /pages/dir1/file/. Is there some setting to tell Hugo to use the pages permalink config for all subfolders? Thank you!
Not tested, but I suppose that at the top level _index.md of a section you could use front-matter cascade to set for example type = "pages" in all descendant content files, so that the permalink configuration kicks in.
It’s not currently published and the template I’m working on is using a purchased theme but let me see if I can get it put somewhere. It’s essentially a hugo new theme <theme> though.
Please remove draft: true from all content files and then the pages permalink configuration should work out-of-the-box e.g. http://localhost:1313/four/
A draft is not published hence no permalink. Also once you do the above you may try removing the cascade front-matter, since it shouldn’t be needed.
So the -D flag is not honored (as in hugo serve -D -w)? The original end goal was for the URL for “four” (content/pages/dir1/four.md) to be /dir1/four/. I can set a URL it just seems the wrong way to solve the problem. I set all the pages to draft: false and there is zero desired change that I can see. I tried with cascade and without.
Right. Now I see -and it seems that I missed part of the original question-.
In the project config you have set: pages = "/:title/"
Therefore with title: Four the permalink will end up being published as /four/ and not /dir1/four/.
I am afraid that you cannot achieve the latter because there is no way to ignore the top section i.e. pages and only output the nested section i.e. dir.
Also if the /:sections/ variable is used in the permalinks configuration it will output the full hierarchy.