# What am I doing wrong?

**URL:** <https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307>\
**Category:** support\
**Created:** [August 19, 2019, 1:58pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307 "2019-08-19T13:58:02Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 19, 2019, 1:58pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/1 "2019-08-19T13:58:02Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [August 19, 2019, 2:05pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/2 "2019-08-19T14:05:11Z")

</div>

slug in the frontmatter is only the current file.

`slug: notes` should work.

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

```auto
url: /141/notes/

```

There might `"` hyphens be needed around those.

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 19, 2019, 11:28pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/3 "2019-08-19T23:28:49Z")

</div>

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/](https://preview.devopsish.com/)

Code here: [https://github.com/chris-short/devopsish.com/tree/notes/content/post/141](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.

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [August 20, 2019, 11:17am UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/4 "2019-08-20T11:17:33Z")

</div>

have you tried page bundles where notes is a resource?

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 20, 2019, 11:58am UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/5 "2019-08-20T11:58:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 20, 2019, 12:02pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/6 "2019-08-20T12:02:20Z")

</div>

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/](https://gohugo.io/content-management/page-bundles/)

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [August 20, 2019, 12:40pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/7 "2019-08-20T12:40:14Z")

</div>

On the [Page Bundles](https://gohugo.io/content-management/page-bundles/#readout) 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.

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [August 20, 2019, 12:59pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/8 "2019-08-20T12:59:35Z")

</div>

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

```auto
resources:
  - src: notes.md
    name: notes

```

You should be able to have it render properly.

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 20, 2019, 5:20pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/9 "2019-08-20T17:20:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [August 20, 2019, 5:39pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/10 "2019-08-20T17:39:12Z")

</div>

> [@ChrisShort](#):
>
> I cannot figure out the right front matter (or directory structure?) to have /141/notes/ also render

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.

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 20, 2019, 5:56pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/11 "2019-08-20T17:56:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [August 20, 2019, 6:11pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/12 "2019-08-20T18:11:33Z")

</div>

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](https://gohugo.io/news/0.57.0-relnotes/) 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.

---

<div class="post-metadata">

**Author:** ![ChrisShort](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrisshort/32/22700_2.png) [@ChrisShort](https://discourse.gohugo.io/u/ChrisShort)\
**Post date:** [August 20, 2019, 6:49pm UTC](https://discourse.gohugo.io/t/what-am-i-doing-wrong/20307/13 "2019-08-20T18:49:39Z")

</div>

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