Help understanding content management and page bundles

I’m confused.

I have a content folder with a post folder in it where I would like to organize my posts into page bundles.

I create a directory like content/post/super-cool-post and maybe an images directory as well content/post/super-cool-post/images then I run hugo new post/supercool-post/postname.md and change the post to not be draft.

I run hugo and I check the site and I don’t see the post. I tried adding a index.md file to the content/post/super-cool-post folder but I’m not sure what the content of the index.md file should be… no matter what I try it still doesn’t make the post show up.

If I create a post like hugo new post/postname.md it works fine.

Create an _index.md file in your content/post/super-cool-post and you can just add something like this to front matter:

---
title: "index"
date: 2020-03-27T19:41:39+01:00
draft: true
---

This is template in super-cool-post folder.

Also check out this video:

I think it explains just whats you need.

Thanks. I watched that video last night.

Why would I use _index.md vs index.md? I’m not fully clear.

In Hugo they mean different things. Check the table explaining them on the page bundles docs.

Thanks. I read that page as well but maybe I’m just not grasping it.

If someone could explain the difference and use cases of each in a couple sentences or something maybe that would help me have that ah ha moment :slight_smile:

1 Like

The way it works is: you have a specific issue and you share your repo so we can see your entire configuration and then we understand what you are trying to do (or ask questions for clarification).

I want to explain to you the difference between “leaf” and “branch” bundles beyond what’s written at https://gohugo.io/content-management/page-bundles/#readout

Leaf Bundle Branch Bundle
Usage Collection of content and attachments for single pages Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list)

I would use your setup as an example, but I don’t know which you are trying to do. So please share your work. :slight_smile:

Thank you. I think I figured it out in the hours since I posted the question.

For anyone else that needs clarification, my issue was I was not using index.md as my page for the page bundle but rather trying to configure additional .md files as my page.

This worked with a _index.md file but not index.md.

So the answer is to use index.md as your page bundle page.

2 Likes