# Potential bug? Content pages fail to generate

**URL:** <https://discourse.gohugo.io/t/potential-bug-content-pages-fail-to-generate/11202>\
**Category:** support\
**Created:** [March 25, 2018, 6:22pm UTC](https://discourse.gohugo.io/t/potential-bug-content-pages-fail-to-generate/11202 "2018-03-25T18:22:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kytrinyx](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kytrinyx](https://discourse.gohugo.io/u/kytrinyx)\
**Post date:** [March 25, 2018, 6:22pm UTC](https://discourse.gohugo.io/t/potential-bug-content-pages-fail-to-generate/11202/1 "2018-03-25T18:22:16Z")

</div>

I’ve been trying to narrow down some unexpected behavior, and I’m not sure if it’s unexpected to me because I’ve failed to understand something fundamental to the hugo library, or if it’s actually unexpected and an indication of a bug.

Here’s what I’m observing:

1. Generate a new hugo site
2. Create a `layouts/_default/single.html` template
3. Create a `content/a.md` markdown file

Generating the site with `hugo` creates the `public/a/index.html` page as expected.

If I then add a `content/index.md` file, then `public/index.html` gets generated with the content of `index.md` using the single page template, but `a.md` is no longer used to generate the `a/index.html` page.

If I build this up using three templates instead of just the one, then I can reproduce the issue with `a.md` not getting generated.

```auto
layouts/
├── _default
│ ├── list.html
│ └── single.html
└── index.html

```

If I create the content like this, then everything works as expected. I get a home page that uses the `layouts/index.html` file, and includes `_index.md`.

```auto
content/
├── _index.md
└── a.md

```

If I _add_ a `content/index.md` file to this and regenerate, it’s all fine. The superfluous `index.md` file gets ignored. However, if I had mistakenly created an `index.md` _instead of_ an `_index.md`, then `a.md` again doesn’t get generated. (The home page is also empty, of course, since there’s no `_index.md` to pull content from).

Is it a bug that `a.md` does not get generated in the presence of an `index.md` file?

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [March 25, 2018, 6:27pm UTC](https://discourse.gohugo.io/t/potential-bug-content-pages-fail-to-generate/11202/2 "2018-03-25T18:27:12Z")

</div>

> [@kytrinyx](#):
>
> Is it a bug that a.md does not get generated in the presence of an index.md file?

No.

See [Page bundles | Hugo](https://gohugo.io/content-management/page-bundles/)

---

<div class="post-metadata">

**Author:** ![kytrinyx](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kytrinyx](https://discourse.gohugo.io/u/kytrinyx)\
**Post date:** [March 25, 2018, 7:42pm UTC](https://discourse.gohugo.io/t/potential-bug-content-pages-fail-to-generate/11202/3 "2018-03-25T19:42:08Z")

</div>

Ok, thanks for the pointer.

From the documentation I now realize where my mental model went wrong:

> leaf means it has no children

Considering that `index.md` and `a.md` were in the same directory, I didn’t think of them as children, but as siblings. In retrospect they’re obviously children because hugo implicitly generates directories for them with `a/index.html`.
