What am I doing wrong?

I think I’ve RTFM’d myself into confusion. I am attempting to have a post and another markdown file published under the same path. Example: https://github.com/chris-short/devopsish.com/tree/master/content/post/141

In the example the index.md renders /141/ just fine. But, I cannot figure out the right front matter (or directory structure?) to have /141/notes/ also render. I’m not sure what thing I’m doing wrong at the point. Any pointers are appreciated.

slug in the frontmatter is only the current file.

slug: notes should work.

the way you are doing it is more the url frontmatter:

url: /141/notes/

There might " hyphens be needed around those.

No joy. Flipping slug = “141/notes” to only “notes” did not seem to render the page either.

Looking at the directory structure, I also tried removing all slugs on eight pages and still didn’t get rendered notes pages.

I have a subset of pages slugged as you described (138-141) rendered here: https://preview.devopsish.com/

Code here: https://github.com/chris-short/devopsish.com/tree/notes/content/post/141

But, the notes pages aren’t there. Like, I’m wondering bug or bad config? I really am scratching my head.

have you tried page bundles where notes is a resource?

Whoa. Didn’t even know that was a thing.

Wait. Yes I did. I’m not quite sure how that applies here though. Could you explain or point to something a little more explanatory than this page? https://gohugo.io/content-management/page-bundles/

On the Page Bundles you can read about leaf vs branch bundles.

You decide the type by how you name the index file, index.html vs _index.html. Notice the underscore, subtle but important difference.

You are using leaf bundles and they can not have children, only resources.

The notes.md file is treated as a resource among others and therefor not render as a page.

Exactly like @frjo said, and if you set something like:

  - src: notes.md
    name: notes

You should be able to have it render properly.

So I read that page, a few times, I still didn’t understand. At this point, does anyone have a working example of this? Because _index.md makes the index page not render at all.

Basically /141/ needs to be a section (or a branch bundle in Hugo terminology ) if you wish for it to have a title etc. you will need to create an _index.md like so: /141/_index.md. This will be a list page with a permalink of /141/

Then within tne above directory you will create another one called /notes/. Within this directory structure you will need to have: /141/notes/index.md so that /notes/ will be published as a single page (or a leaf bundle in Hugo terminology) and it will have a permalink of /141/notes/. Within /notes/index.md you may enter whatever content you wish.

Thanks. A list page is not the desired behavior though. The desired behavior is that /141/ is a page by itself with its own unique content and notes.md is also a unique page with its own content /141/ and /141/notes/ respectively. Is that even possble?

I specified which page is a list type and which isn’t so that you know the templates that govern them.

But in any case you can make both the list page /141/ have the same layout as the single page /notes/ by defining it in a front matter parameter i.e. layout = "pages"

Also since Hugo v.0.57.0 Cascading Front Matter is possible so you could enter the above parameter at the top most _index.md of a section and its children will inherit it.

What you’re asking is not possible. The child of a leaf bundle does not get its own permalink. In any case this is the internal workings of Hugo. The output can be made as you like.

The permalink structure you originally asked for is possible.

Then I have discovered a bug it would seem. The pages render in hugo server. Hence the absolute confusion. Thanks all!