Apologies for a newbie question, but I’m struggling with setting up a directory structure so that all my pages are not top level. I’ve read the docs, but when I put pages in a folder structure, Hugo does not generate them. If I move them back to the top level everything works as expected.
These pages are all simple single static web pages.
This works
content
history
_index.md
join
_index.md
leaders
_index.md
themes
custom (theme name)
layouts
history
list.html
join
list.html
leaders
list.html
This does not work
content
about
history
...
themes
custom
layouts
about
history
...
However, when I try and nest the folders in content and layouts under an “about” folder, Hugo does not render the .HTML files, just an index.xml file.
Thank you in advance for helping me organize my website, greatly appreciated!!
You cannot nest layout files in the same way you can do with content files.
As pointed out above, you need to consider (and thoroughly read about) Hugo’s lookup order, and specify custom types or layouts in the frontmatter as necessary.
You also do not need to tag specific people to ask for help. We are all volunteers here, and people will help out when they know the answers and have the free time to do so.
I changed my project to not nest the layout folders, so all the folders in the layout are top-level, but when I build it I’m not getting the HTML files only XML files in the public about/history about/join and about/leaders folders.
I’ve searched for an example, but can’t find one. This seems like a very common scenario, creating folders to put content in so that all the content folders are not top-level to content.
Thinking of another example, a site that presents information for states and cities in that state. This would require a content/state name folder for each state, and then subfolders for cities.
I hope I’m making sense. I’ve reread the docs twice, but obviously not connecting the dots.
Any example would be greatly appreciated.
BTW: I do not use the posts feature, all pages on my site are content pages without the blog posts features.