# Is it possible to have a homepage not using \_index.md?

**URL:** <https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906>\
**Category:** support\
**Created:** [January 27, 2021, 8:10pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906 "2021-01-27T20:10:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoHood](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nicohood/32/12720_2.png) [@NicoHood](https://discourse.gohugo.io/u/NicoHood)\
**Post date:** [January 27, 2021, 8:10pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/1 "2021-01-27T20:10:38Z")

</div>

Hey there!  
I try to create a modular homepage. This means I want to have my content split into multiple .md files. This is possible by using a leaf bundle.

However this does not seem to work for the home page, since all sub pages would be treated as page resource. I also tried to move the root page into `/home` and set `slug: '/'`. This is working so far, however `IsHome` returns true in that case.

I have the feeling, that the homepage can only be placed inside a `_index.md` file or by directly using the theme `index.html` template. But that would mean modular pages (e.g. implemented via leaf bundles) is not possible at all with hugo (0.80). Is that correct?

---

<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:** [January 27, 2021, 9:32pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/2 "2021-01-27T21:32:06Z")

</div>

> [@NicoHood](#):
>
> I have the feeling, that the homepage can only be placed inside a `_index.md` file or by directly using the theme `index.html` template. But that would mean modular pages (e.g. implemented via leaf bundles) is not possible at all with hugo (0.80). Is that correct?

No. It is not correct.

The `_index.md` is an optional file for list pages -including the homepage- meant for adding metadata, content etc.

By default the template that controls the homepage would be `/layouts/index.html` or `/layouts/_default/index.html`

However you can do whatever you need.

For example by setting the `url` front matter parameter of an `index.md` (leaf page bundle) to the `baseURL` value would effectively turn that page into the homepage. Also this leaf bundle can be ruled by whatever template you wish via setting the `layout` front matter parameter.

Yes, it is possible to have a modular -as you put it- homepage with its own page resources and custom template, without having to turn the entire `contentDir` into the leaf bundle of the homepage.

---

<div class="post-metadata">

**Author:** ![NicoHood](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nicohood/32/12720_2.png) [@NicoHood](https://discourse.gohugo.io/u/NicoHood)\
**Post date:** [January 27, 2021, 10:28pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/3 "2021-01-27T22:28:36Z")

</div>

I see, but setting `url` in the frontmatter still does not give me `IsHome` set to true. I expected that hugo would have a feature like specifying the homedir in config.toml. That would make most sense I guess.

---

<div class="post-metadata">

**Author:** ![NicoHood](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nicohood/32/12720_2.png) [@NicoHood](https://discourse.gohugo.io/u/NicoHood)\
**Post date:** [January 29, 2021, 1:16pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/5 "2021-01-29T13:16:55Z")

</div>

I’ve seen your email about `kind = home`, but you have deleted the post. It also does not seem to work, is it a bug?

---

<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:** [January 29, 2021, 1:24pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/6 "2021-01-29T13:24:05Z")

</div>

No. It is not a bug. `kind` cannot be set manually. (I remembered afterwards).

But above you mentioned that if you use a directory called `/home/` as a leaf bundle then in this case `.IsHome` returns `true`. Is that so? (currently I’ve no time for testing myself).

---

<div class="post-metadata">

**Author:** ![NicoHood](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nicohood/32/12720_2.png) [@NicoHood](https://discourse.gohugo.io/u/NicoHood)\
**Post date:** [January 29, 2021, 2:28pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/7 "2021-01-29T14:28:49Z")

</div>

No, it sadly does not return true, but I need it to do so.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [January 30, 2021, 5:50am UTC](https://discourse.gohugo.io/t/is-it-possible-to-have-a-homepage-not-using-index-md/30906/8 "2021-01-30T05:50:50Z")

</div>

> [@NicoHood](#):
>
> I want to have my content split into multiple .md files.

Have `content/_index.md` as your main homepage content, then

```auto
content
├── home
│ ├── _index.md
│ ├── one.md
│ ├── two.md
│ └── three.md

```

Where `home/_index.md` is a headless collection: [Build options | Hugo](https://gohugo.io/content-management/build-options/#not-publishing-a-page)

Then in your `layouts/index.html`

```auto
{{ $home := site.GetPage "home" }}

{{ range $home.Pages }}
etc

```
