Nested Content

Hi guys. Just getting started with Hugo and trying to fully understand the philosophy regarding content organisation. On initial reading of the docs, it seemed it would be trivial to lay out my website, which has multiple nested subcategories. I figured I could easily make a structure like /products/category1/subcategory1, /products/category1/subcategory2 etc. just by replicating that folder structure in the source content. I got this from the line “Hugo supports content nested at any level.” and the subsequent diagram in the ‘Content Organisation’ doc.

Now I’ve spent a few days with Hugo and am trying to implement my structure, it seems this doesn’t work. I started with all my products in the /products/ folder (inside ‘Content’ obviously) and got a perfect list page with all my products. I then spent some time creating the subfolder structure and moving the .md files for each product into the correct subfolder. I was surprised to find when navigating to any subfolder under /products, that no list was shown.

Looking around in this forum, I can see a number of other similar questions, but I really want to try to clarify this in my mind. If Hugo doesn’t generate lists for each subfolder underneath the first level in ‘Content’, how can it be stated that “Hugo supports content nested at any level.”? Am I misunderstanding something? Why would I nest content If I can’t display in a list?

Really sorry if I’m missing something, but the answers to the other similar questions seem to be saying that Hugo doesn’t support sub-sections, when the documentation seems to suggest that this is one of the main features…?

This may be overreaching in the documentation and should be clarified. I never read it like you do.

To be clear:

  • Hugo supports only one level of sections, which is the first folder in /content if not set in front matter.
  • You can, however, have as deep a file structure as you want in /content (which is what I think is meant by the doc you refer to)

@bep Is supporting multiple level of section can be a feature request or it’s really not hugo’s philosophy?

It would be a nice addition, but I think it’s already in GitHub.