URL to specific directories

Is it possible to render specific folder paths at a different url than their directory structure?

My current site has this structure:

  • content - site root
    • container-folder - I don’t want to render this

I can’t get the news or notes pages rendering correctly even if I specify the url and layout in frontmatter. If I change the _.index.md files to index.md I can access the index page but I can’t access or list the pages in news or notes.

Is there any way I can accomplish this? Thanks.

Not in the way you ask.

But you can create your desired URL with an _index.md and then in its corresponding template under/section/ you can use range to render these posts in a list.

Or use taxonomies. If these posts share the same tag they will be rendered in a list page under said tag.

So thanks to your feedback I got a page in the site root displaying the pages in the nested folder the only issue I have now is they display the full path of the files.

For example: site-root/container-folder/news/post1 instead of site-root/news/post1

If there is any way to accomplish this it would solve my problems, thanks.

This is not currently possible in Hugo.

Crap, well thanks for your help I did learn something along the way, so thank you :wink: