So for each ‘section’, i want to have a folder in archetypes, content, layouts, and data and partials independently. This means, not so much that everything is a page, but rather everything is a ‘section’, and the home stuff can happily hang out in ‘section’ _default. Or have I just misunderstood this and what I am thinking of as a ‘section’ is how you guys think of as a ‘page’?
Please note, the above is not a criticism of the design decisions taken in building Hugo. I am trying to understand it better to work out how to use for my specific use case.
Sorta. You don’t need folders in archetypes—just individual archetypes that represent each section.
Partials make the most sense in their current location since you should conceive of them as “partial templates.”
It sounds like you are getting the right idea on how to organize your projects, but don’t feel that things need to be that rigid. Hugo has been designed to leverage a lot of smart “sane defaults” to keep your templating dry. One thing you should definitely familiarize yourself with is Hugo’s lookup order. (Btw, this applies to more than just templates.) If you are a new user, the following is from the docs concept site and I would certainly appreciate any feedback:
@rdwatters - massively appreciate the super quick response. Follow up q if ok? I think I understand how you are thinking about archetypes.
(a) So technically, frontmatter in a section’s _index.md is the single archetype for that section. A archetypes/<section-name>.md is the frontmatter for a section’s list archetype?
(b) trying to better understand the logic, section ‘root’ can be described as layouts/index.htmlorlayouts/_default/list.html? Taking the example a little bit further (for illustrative purposes), would a custom 404 be able to be described as layouts/_default/404.html in addition to the current layouts/404.html?
I think the way to think of it is that the frontmatter for any piece of content is really setting metadata for that piece of content. A section’s _index.md doesn’t need any specific frontmatter from an archetype, though if you create it using hugo new <SECTION>/_index.md it will of course have it.
Depending on how you are rendering that section, you will have some variables that you definitely want, like maybe a title or something.
404’s are kinda weird. Whereas your site can only have a single homepage, it is also common for webservers to serve a specific template when that error code is encountered; hence 404.html is an not like the other pieces of content you will build with Hugo.
I don’t fully understand your “b” question, so maybe just keep in mind that there are different lookup orders for different template, and focus on one lookup order at a time (in this case, sections).