# Homepage content from content/home.md

**URL:** <https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54>\
**Category:** support\
**Created:** [September 19, 2014, 11:26am UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54 "2014-09-19T11:26:23Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![stp-ip](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stp-ip](https://discourse.gohugo.io/u/stp-ip)\
**Post date:** [December 6, 2016, 3:43pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/23 "2016-12-06T15:43:15Z")

</div>

That was one of my tries.

It works for single content pages such as content/\_index/index.md or content/\_index/hero.md, but as bep confirmed it is not ready for single page apps, which basically provider multiple files for this.

It basically errors on using content/\_index/ with multiple files. I would love this to work as that is the cleanest method.

Afaik this would solve the index.xml issue, the /index/ not 404 issue and issues with the sitemap.

---

<div class="post-metadata">

**Author:** ![robsonsobral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/robsonsobral/32/1628_2.png) [@robsonsobral](https://discourse.gohugo.io/u/robsonsobral)\
**Post date:** [December 6, 2016, 3:56pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/24 "2016-12-06T15:56:27Z")

</div>

I’ve been struggling to find a way to choose which content files to generate or not the pages. For now, only data files, but they have other issues (like the dammed trimmed `<p>`).

---

<div class="post-metadata">

**Author:** ![robsonsobral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/robsonsobral/32/1628_2.png) [@robsonsobral](https://discourse.gohugo.io/u/robsonsobral)\
**Post date:** [January 6, 2017, 4:52pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/25 "2017-01-06T16:52:22Z")

</div>

A folder called `_index/` causes `panic: Too many homes` error on version `0.18`.

We really need a way to hide a folder of `.md` files.

---

<div class="post-metadata">

**Author:** ![Toma](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/toma/32/3691_2.png) [@Toma](https://discourse.gohugo.io/u/Toma)\
**Post date:** [June 28, 2017, 1:58am UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/26 "2017-06-28T01:58:56Z")

</div>

Just wondering if there has been any more development with this.

I have a page in the content folder `content/about.md` whose contents I would like to render on the home page. So far this is the only thing that worked for me:

```auto
{{ range (where .Pages "Title" "About") }}
    {{ .Content }}
{{ end }}

```

Is there a better solution for rendering a single content page that is not part of a section?

---

<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:** [June 28, 2017, 5:17pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/27 "2017-06-28T17:17:19Z")

</div>

I believe this will work @Toma:

```auto
{{ with $.Site.GetPage "page" "about" }}{{.Content}}{{end}}

```

---

<div class="post-metadata">

**Author:** ![Toma](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/toma/32/3691_2.png) [@Toma](https://discourse.gohugo.io/u/Toma)\
**Post date:** [June 28, 2017, 7:12pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/28 "2017-06-28T19:12:46Z")

</div>

Hey @rdwatters, that didn’t work but this did:

```auto
{{ with $.Site.GetPage "page" "about.md" }}{{.Content}}{{end}}

```

Btw, what does `with` and the `$` do here?

---

<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:** [June 28, 2017, 7:22pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/29 "2017-06-28T19:22:20Z")

</div>

> [@Toma](#):
>
> Btw, what does with and the $ do here?

`with` checks for the existence of whatever’s being passed and then rebinds the context (i.e., `.`) within its scope:

> **[Templating](https://gohugo.io/templates/introduction/)**
>
> Hugo uses Go's \`html/template\` and \`text/template\` libraries as the basis for the templating.

`$` tells Hugo to look to the top-level context.

`.Site.GetPage` is a really cool, and often underutilized, function:

> **[Functions](https://gohugo.io/functions/)**
>
> A list of Hugo template functions including examples.

---

<div class="post-metadata">

**Author:** ![Toma](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/toma/32/3691_2.png) [@Toma](https://discourse.gohugo.io/u/Toma)\
**Post date:** [June 28, 2017, 7:33pm UTC](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54/30 "2017-06-28T19:33:16Z")

</div>

Ah ok, thank you for the explanation. `.Site.GetPage` was one of the things I tried initially but didn’t get the syntax quite right.

Is there a Hugo doc page that shows all of the different parameters or arguments that can be passed into `.Site.GetPage`? Like “page” and “section” and “Title”?

[Previous page](https://discourse.gohugo.io/t/homepage-content-from-content-home-md/54.md?page=1)
