Hugo sections
Sections are top level folders, or any folder with a _index.md
. You can
nest sections by putting a sub-folder with a _index.md
file.
Why _index.md
and not index.md
? What’s the different between the two?
When you tuck an _index.md
file under a folder, it becomes a branch
bundle - I think this is just another name for a section.. Each md file
underneath gets their own URL. When you use an index.md
file on the other
hand, the folder becomes a leaf bundle - any files under the folder,
including md files, become resources associated with the page, without their
own URLs.
In addition, an _index.md
will become a list page, using alist template
and all the md files underneath will be available to the page through a
loop. An index.md is just a regular page, with no access to the md files
underneath, using the single template.