# Why my layout is not used, but single.html instead?

**URL:** <https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435>\
**Category:** support\
**Created:** [April 8, 2018, 10:33am UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435 "2018-04-08T10:33:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![openscript](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/openscript/32/4511_2.png) [@openscript](https://discourse.gohugo.io/u/openscript)\
**Post date:** [April 8, 2018, 10:33am UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/1 "2018-04-08T10:33:53Z")

</div>

Hi there

I’ve the following situation:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/d/d0c6de0141530e802411e8330949048f15c12d1a.png)

The question is, why is my `about.html` layout not used, but the `_default/single.html`?

I want that the about content is a section on the homepage, which should be rendered with a section template. Is this the way to achieve it?

Thank you in advance!  
Robin

---

<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:** [April 8, 2018, 11:28am UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/2 "2018-04-08T11:28:02Z")

</div>

Give it a type= “page” and then move the template under /layouts/page/single.html

---

<div class="post-metadata">

**Author:** ![openscript](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/openscript/32/4511_2.png) [@openscript](https://discourse.gohugo.io/u/openscript)\
**Post date:** [April 8, 2018, 11:34am UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/3 "2018-04-08T11:34:35Z")

</div>

That works flawlessly. Thank you!

After reading the documentation about that topic, this behavior is not intuitive to me. Is it done like this by intention?

---

<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:** [April 8, 2018, 11:38am UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/4 "2018-04-08T11:38:02Z")

</div>

Hugo’s template look up order has been like that for ages.

I also had some difficulty wrapping my head around it when I first started using Hugo.

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [April 8, 2018, 1:31pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/5 "2018-04-08T13:31:29Z")

</div>

> [@openscript](#):
>
> The question is, why is my about.html layout not used, but the \_default/single.html?

First of all there is no `about.html` “layout file”, it’s just a partial. A partial does not get picked up automatically… you need to call it using {{ partial “foo.html” . }}`.

> [@](#):
>
> I want that the about content is a section on the homepage, which should be rendered with a section template. Is this the way to achieve it?

Any .md file in `content` that is **not** `_index.md` will automatically use the `single.html` (by default, if `type` or `layout` is not overridden in the front-matter).

If you want to render the about page as a section, **make it a section** … move `content/about.md` to `content/about/_index.md`.

For further reading on the `_index.md`, I’d suggest:

> **[Page bundles](https://gohugo.io/content-management/page-bundles/#branch-bundles)**
>
> Content organization using Page Bundles

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [April 8, 2018, 1:35pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/6 "2018-04-08T13:35:05Z")

</div>

> [@alexandros](#):
>
> I also had some difficulty wrapping my head around it when I first started using Hugo.

@openscript I suggest that you look at the auto-generated documentation on layout lookup order here:

> **[Template lookup order](https://gohugo.io/templates/lookup-order/)**
>
> Hugo uses the rules below to select a template for a given page, starting from the most specific.

It’s very much consistent through the different cases, and once you carefully look at few of the examples in there, that consistency with “click” for you too. _I believe that the layout lookup consistency and flexibility in Hugo is not getting the credit it deserves 🙂_

---

<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:** [April 8, 2018, 1:42pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/7 "2018-04-08T13:42:18Z")

</div>

> [@kaushalmodi](#):
>
> First of all there is no about.html “layout file”, it’s just a partial. A partial does not get picked up automatically… you need to call it using {{ partial “foo.html” . }}`

It wasn’t a partial. Look again the above screenshot of his directory tree.

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [April 8, 2018, 2:04pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/8 "2018-04-08T14:04:29Z")

</div>

What am I missing? ~~I see `layouts/partials/about.html`.~~

Nevermind, I realized my mistake… the `partials/` directory is probably not expanded based on that arrow direction.

 ![Screenshot_20180408-095232](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/5/5bf259641c85c639aa8c62df1dd8aabe498822ac.jpg)

---

<div class="post-metadata">

**Author:** ![openscript](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/openscript/32/4511_2.png) [@openscript](https://discourse.gohugo.io/u/openscript)\
**Post date:** [April 8, 2018, 2:51pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/9 "2018-04-08T14:51:01Z")

</div>

Thank you very much for the explanation. 🙂

---

<div class="post-metadata">

**Author:** ![openscript](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/openscript/32/4511_2.png) [@openscript](https://discourse.gohugo.io/u/openscript)\
**Post date:** [April 8, 2018, 3:04pm UTC](https://discourse.gohugo.io/t/why-my-layout-is-not-used-but-single-html-instead/11435/10 "2018-04-08T15:04:34Z")

</div>

If I do like you described with the sections, the about page is not rendered within the home page.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/7/745cd2274bf529b77a9c4c3b299efeec49b7f60f.png)

The layout about.html consists of: `{{ .Content }}`
