I'm a bit confused about when to use leaf bundles versus branch bundles

Hello, I’ve read about “leaf” and “branch” bundles in the Hugo documentation, but I’m honestly a bit confused. It’s not that the documentation isn’t good. I think I might not fully understand it since English isn’t my first language.

If I have a simple page about myself, like an “About” or “Contact” page, even if they contain images, these pages should be leaf bundles, right? something like this:

+ content
       + about
           index.org
           about-picture-1.jpg
           about-picture-2.jpg
       + contact
           index.org

I’ve been using _index.org in these folders so far, but I don’t think it’s the right choice. Should I just be using index.org instead?

As for blog posts, can I still use leaf bundles even if each post is in a separate folder, as long as I don’t need to include another bundle in a bundle?

I think this is still leaf boundle, right?

+ content
      + posts
          + 2024
              + 2024-08-10-first-post
                  index.org
                  post-picture1.jpg
                  post-picture2.jpg
              + 2024-08-11-second-post
                  index.org
                  post-picture1.jpg
                  post-picture2.jpg
               + ....
           + 2025
1 Like

Yes.

Another way to think about this is sections vs. pages.

If you want a directory to be a section with zero or more descendant pages, rendered by a list template, the directory should contain an _index.md file.

If you want a directory to be a single page, rendered by a single template, the directory should contain an index.md file.

In the above, replace .md with extension corresponding to the content format (e.g., .adoc for AsciiDoc, .org for Emacs Org Mode, etc.).

2 Likes