Naming sections and folders

Hi, I have a book structure of content. Some articles are in a section folder named ‘Fish and Chips’. When you run Hugo 0.14 it generates a:

fish-and-chips/index.html file which is what I expect.

But all articles inside are generated as:

Fish and Chips/some-article/index.html

And on _default/section.html the var {{.Title}} gives you a third convention: Fish-And-Chips.

How do you approach this? How do I keep section folder names, their titles and url structure intact?

Thank you!

I see a bug or two here, but it will not solve your problem. But please open up one at GitHub (there may exist a similar one, do not remember). Just paste a link back to this discussion.

We should be able to keep the .Title intact, with spaces and all.

Until we fix this, I would suggest you just name the folder “fish-and-chips” – and use the strings template funcs to fix up the title.

Thanks, I’ll open an issue. Renaming would partly solve it but I intentionally name my folders as the titles because I want the source to be as close to the compiled output as possible.

You would have to build from source to get this fix now. But with Go that is pretty straight forward.

1 Like