# \[SOLVED\] Why does this build XML rather than HTML?

**URL:** <https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049>\
**Category:** support\
**Created:** [April 5, 2017, 4:42pm UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049 "2017-04-05T16:42:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnykates](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jonnykates/32/2944_2.png) [@jonnykates](https://discourse.gohugo.io/u/jonnykates)\
**Post date:** [April 5, 2017, 4:42pm UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/1 "2017-04-05T16:42:46Z")

</div>

Hi guys,

Firstly apologies for this incredible banal post - I’m certain I’m doing something very basic very wrong. Just trying to get to grips with Hugo for the first time.

[https://github.com/jonnykates/testinghugo](https://github.com/jonnykates/testinghugo)

I can’t figure out why Hugo fails to build my content/about/\_index.md file properly. I am starting with a completely blank theme; for which I thought I have scaffolded the layouts correctly. To my mind, it should be using layouts/baseof.html as the template for building my about page.

Any pointers would be amazing - sorry again for being useless!

Jonny

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [April 5, 2017, 5:07pm UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/2 "2017-04-05T17:07:09Z")

</div>

> [@jonnykates](#):
>
> I can’t figure out why Hugo fails to build my content/about/\_index.md file properly.

One thing to note is that all `_index.md` pages are considered [list pages](https://hugodocs.info/templates/lists), so they when it comes to the [Hugo lookup order](https://hugodocs.info/templates/lookup-order/), Hugo is going to look for a template at `layouts/_default/list.html` to render your `content/about/_index.md`.

Since I’m not 100% on what you’re trying to do, it’s also worth nothing that a file at `content/about.md` is going to render–at least at the terminus of the lookup order–via the template you create at `layouts/_default/single.html` because it’s then a [single content page](https://hugodocs.info/templates/single-page-templates/) and not a list page.

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [April 5, 2017, 5:13pm UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/3 "2017-04-05T17:13:14Z")

</div>

**[[UPDATE]]** I took a quick look at your GH repo, and to add to the comment I made above re: list page, it looks like your default `list.html` does not have anything in it, so Hugo has nothing to look to to render the page

[https://github.com/jonnykates/testinghugo/blob/master/themes/jfk/layouts/\_default/list.html](https://github.com/jonnykates/testinghugo/blob/master/themes/jfk/layouts/_default/list.html)

> [@jonnykates](#):
>
> To my mind, it should be using layouts/baseof.html as the template for building my about page.

It also look like you do not have any blocks defined in your `layouts/_default/baseof.html`:

[https://github.com/jonnykates/testinghugo/blob/master/themes/jfk/layouts/\_default/baseof.html](https://github.com/jonnykates/testinghugo/blob/master/themes/jfk/layouts/_default/baseof.html)

Here is an example of what you’re probably looking for…

```auto
<!--layouts/_default/baseof.html-->
{{ partial "header.html" }}  
    {{ block "main" . }}  
      {{ .Content }}  
    {{ end }}
{{ partial "footer.html" }}

```

Then in your `layouts/_default/list.html` you can do something like the following:

```auto
{{ define "main" }}
<h1>{{.Title}}</h1>
  {{ .Content }}
{{ end }}

```

**Note:** In `layouts/_default/list.html` the code you put inside the `main` block will overwrite whatever you include inside the `main` block in `baseof.html` as “default” content.

---

<div class="post-metadata">

**Author:** ![jonnykates](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jonnykates/32/2944_2.png) [@jonnykates](https://discourse.gohugo.io/u/jonnykates)\
**Post date:** [April 6, 2017, 7:38am UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/4 "2017-04-06T07:38:49Z")

</div>

Thanks for your replies, hugely helpful. I’ll dive back into it later - I only have a couple of minutes but I wanted to just say thanks.

> [@rdwatters](#):
>
> One thing to note is that all \_index.md pages are considered list pages, so they when it comes to the Hugo lookup order, Hugo is going to look for a template at layouts/\_default/list.html to render your content/about/\_index.md.

When I named the content file `_index.md`, I was trying to follow the organisation example [as per the documentation](https://gohugo.io/content/organization/):

```auto
└── content
    └── about
    | └── _index.md // <- http://1.com/about/

```

If that’s a listing page, what exactly is it listing? There are no other child items or sections within that /about/ parent. To convert it to a ‘single’ page type, is it a case of removing the prefixed underscore from the markdown file?

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [April 6, 2017, 4:57pm UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/5 "2017-04-06T16:57:05Z")

</div>

> [@jonnykates](#):
>
> If that’s a listing page, what exactly is it listing?

I think [the new explanation in the concept site might help](https://hugodocs.info/templates/lists). I normally explain in the forums, but I’m at work 😄 Basically, it’s “listing” all the pages in that section…even if it’s just a list of _one_. I also appreciate this is confusing, but it comes in so damn handy as your sections grow. Technically, everything is a “page” in that everything now has access to [page variables](https://hugodocs.info/variables/page).

If you want Hugo to see your `/about` page as a single content page, you can also just move it to `content/about.md` in your source. Please LMK if you have anymore questions.

---

<div class="post-metadata">

**Author:** ![jonnykates](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jonnykates/32/2944_2.png) [@jonnykates](https://discourse.gohugo.io/u/jonnykates)\
**Post date:** [April 7, 2017, 8:15am UTC](https://discourse.gohugo.io/t/solved-why-does-this-build-xml-rather-than-html/6049/6 "2017-04-07T08:15:17Z")

</div>

Ah OK! I think I’m getting somewhere now 😄

Thanks for indulging me - appreciated. Solved.
