# Can’t get both static home page AND pages in sub folders to work at the same time

**URL:** <https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378>\
**Category:** support\
**Created:** [June 27, 2019, 3:55am UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378 "2019-06-27T03:55:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 3:55am UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/1 "2019-06-27T03:55:49Z")

</div>

Beating my head on this wall way too long. If I use content/\_index.md my pages in subdirectories all work just fine, but the home page is a list of blog posts. If I use content/index.md my home page works but all other pages linked on the menu are 404.

I have tried changing the content of theme/hugo-casper-two/layouts/index.html but this does not seem to change anything.

My content structure is like this, mainly due to a couple of shortcuts I’m using:

Content/\_index.md  
Content/about/index.md  
Content/about/images/(multiple jpegs)

Etc.

What am I doing wrong on this one?

---

<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:** [June 27, 2019, 4:56am UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/2 "2019-06-27T04:56:04Z")

</div>

Docs here: [https://gohugo.io/content-management/page-bundles/](https://gohugo.io/content-management/page-bundles/)

Using `content/index.md` means that Hugo interprets your page as a Leaf Bundle. This means that all other page-type content under it are treated as Page Resources, which in this case would have no Permalinks.

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 12:17pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/3 "2019-06-27T12:17:28Z")

</div>

Ok, thanks. I think I understand that a bit better now, but how do I tell Hugo to stop using a list of blog posts for the home page? It is defaulting to that, even with no index.md in /content/, and I can’t find where the theme specifies it…

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [June 27, 2019, 12:37pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/4 "2019-06-27T12:37:42Z")

</div>

It’ll be in the homepage template, likely one of:

```
layouts/index.html
layouts/home.html
```

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 12:58pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/5 "2019-06-27T12:58:16Z")

</div>

After severely modifying layouts/index.html, nothing changes. Is it using layouts/\_default/list.html instead?

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 1:12pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/6 "2019-06-27T13:12:21Z")

</div>

Site: [https://dixonwildlifeart.com/](https://dixonwildlifeart.com/)  
Code: [https://github.com/dixonge/dwa-hugo](https://github.com/dixonge/dwa-hugo)

---

<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:** [June 27, 2019, 1:13pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/7 "2019-06-27T13:13:30Z")

</div>

Hugo follows the following lookup rules: [https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-home-page](https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-home-page)

---

<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:** [June 27, 2019, 1:23pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/8 "2019-06-27T13:23:25Z")

</div>

The [index.html](https://github.com/dixonge/dwa-hugo/blob/master/themes/casper-two/layouts/Index.html) in your theme is named `Index.html`, note the capital `I`. Hugo does not recognise this, so then moves down the list as per the layout lookup rules I linked to above, to find the next available layout file, and uses instead `_default/list.html`.

Rename `Index.html` to `index.html` with small letter `i` so Hugo recognises and uses that layout.

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 1:50pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/9 "2019-06-27T13:50:45Z")

</div>

So I am back where I started. Home page content with no other content, or home page as blog post list with all other sections working fine.

So how do I get a static home page with single layout and multiple nested leaf bundles underneath it?

---

<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:** [June 27, 2019, 1:59pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/10 "2019-06-27T13:59:00Z")

</div>

1. Use `_index.md` if you want child pages.
2. Modify `layouts/index.html` to reflect what you want to be rendered in your homepage.

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 2:00pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/11 "2019-06-27T14:00:00Z")

</div>

> [@pointyfar](#):
>
> The [index.html](https://github.com/dixonge/dwa-hugo/blob/master/themes/casper-two/layouts/Index.html) in your theme is named `Index.html` , note the capital `I` .

Yeah I am doing my editing in iOS Safari. Auto-caps is driving me crazy,

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 2:01pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/12 "2019-06-27T14:01:46Z")

</div>

> [@pointyfar](#):
>
> Modify `layouts/index.html` to reflect what you want to be rendered in your homepage.

This is what I have been attempting since yesterday. Changes to that file do not seem to be recognized. Will try again…

---

<div class="post-metadata">

**Author:** ![dixonge](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dixonge/32/8756_2.png) [@dixonge](https://discourse.gohugo.io/u/dixonge)\
**Post date:** [June 27, 2019, 2:11pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/13 "2019-06-27T14:11:38Z")

</div>

So I renamed the file to \_index.md and modified theme/themename/layouts/index.html by commenting out the post-list partial and inserting a `{{ .Content }}` section.

It worked! Fugly, but functional. It’s all cleanup and css from here.

THANK YOU! All of you, seriously…

---

<div class="post-metadata">

**Author:** ![TenSketch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tensketch/32/9006_2.png) [@TenSketch](https://discourse.gohugo.io/u/TenSketch)\
**Post date:** [July 25, 2020, 9:48am UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/14 "2020-07-25T09:48:21Z")

</div>

Hi,

I’m trying to do something similar to this,

I want my pages to be like this:

> gallery/tattoo-making/  
> gallery/tattoo-removal/  
> gallery/tattoo-training/

I created .md files like this:  
 ![Screenshot_1](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/c/c27ae155fb35cb98a214708435d45fdb6e487912.png)

and under theme/themename/layouts:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/0/07624f1da67e0f7d1b7a5aa9b756b280d7fc3491.png)

But when I open the page localhost:1313/gallery/tattoo-making/  
only home page renders

What should I do to create multiple paths under one folder name?

I got the solution from this link:  
[https://discourse.gohugo.io/t/my-experiences-with-hugos-template-lookup-order/9959](https://discourse.gohugo.io/t/my-experiences-with-hugos-template-lookup-order/9959)

---

<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:** [July 25, 2020, 12:26pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/15 "2020-07-25T12:26:05Z")

</div>

Hi there,

I am closing this topic as this question has been marked as solved. If the solution here does not work for you, please open a new topic. Have a read about [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) to see how to ask for help, and please note the section on showing us your code. Screenshots are not really helpful.

---

<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:** [July 25, 2020, 12:26pm UTC](https://discourse.gohugo.io/t/can-t-get-both-static-home-page-and-pages-in-sub-folders-to-work-at-the-same-time/19378/16 "2020-07-25T12:26:12Z")

</div>


