# Cannot override /\_default/list.html

**URL:** <https://discourse.gohugo.io/t/cannot-override-default-list-html/48453>\
**Category:** support\
**Created:** [February 23, 2024, 3:28pm UTC](https://discourse.gohugo.io/t/cannot-override-default-list-html/48453 "2024-02-23T15:28:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vilim\_Zovko](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vilim_zovko/32/20136_2.png) [@Vilim\_Zovko](https://discourse.gohugo.io/u/Vilim_Zovko)\
**Post date:** [February 23, 2024, 3:28pm UTC](https://discourse.gohugo.io/t/cannot-override-default-list-html/48453/1 "2024-02-23T15:28:02Z")

</div>

I’m trying to create different list.html templates for different sections:

content/something/2007/\_index.md, article1.md, article2.md, article3.md  
content/something/2008/\_index.md article1.md, article2

The goal is to list the 2007 and 2008 sections in different ways.

The default list I want to override.  
themes/my-theme/layouts/\_default/list.html

First I tried to adjust the theme, so I added the following layout inside the theme:

themes/mytheme/layouts/something/2007/list.html  
themes/mytheme/layouts/something/2008/list.html

It didn’t work, themes/my-theme/layouts/\_default/list.html was loaded.

Then I tried to adjust the project root:

/content/something/2007/\_index.md, article1.md, article2.md, article3.md  
/content/something/2008/\_index.md article1.md, article2

/layouts/something/2007/list.html  
/layouts/something/2008/list.html

This didn’t work either.

Is this the correct approach and can this be achieved in this way?

When one of these two desired /2007/list.html and /2008/list.html was placed in /temes/my-theme/layouts/\_default/list.html then that view would work.

This has been tested in a local development environment.

Environment.:

Windows 10,  
hugo v0.123.2-929b91fe75cb0d041f22b4707700dfc117115ad4+extended windows/amd64 BuildDate=2024-02-22T15:27:15Z VendorInfo=gohugoio  
go version go1.22.0 windows/amd64

Ubuntu 22.04,  
hugo v0.123.2-929b91fe75cb0d041f22b4707700dfc117115ad4+extended linux/amd64 BuildDate=2024-02-22T15:27:15Z VendorInfo=snap:0.123.2  
go version go1.22.0 linux/amd64

Notes:  
When starting the “hugo server” server, a /public/ folder is always created, I’m not sure if this is correct.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 23, 2024, 3:30pm UTC](https://discourse.gohugo.io/t/cannot-override-default-list-html/48453/2 "2024-02-23T15:30:39Z")

</div>

> [@Vilim\_Zovko](#):
>
> Is this the correct approach

No. See [https://gohugo.io/templates/lookup-order/#target-a-template](https://gohugo.io/templates/lookup-order/#target-a-template).

> [@Vilim\_Zovko](#):
>
> a /public/ folder is always created, I’m not sure if this is correct.

Yes, it is. With v0.123.0 `hugo server` renders to disk. If you want to render to memory, use the `renderToMemory` flag.

---

<div class="post-metadata">

**Author:** ![Vilim\_Zovko](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vilim_zovko/32/20136_2.png) [@Vilim\_Zovko](https://discourse.gohugo.io/u/Vilim_Zovko)\
**Post date:** [February 23, 2024, 8:50pm UTC](https://discourse.gohugo.io/t/cannot-override-default-list-html/48453/3 "2024-02-23T20:50:26Z")

</div>

Thank you, jmooring. It’s working now.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 25, 2024, 8:50pm UTC](https://discourse.gohugo.io/t/cannot-override-default-list-html/48453/4 "2024-02-25T20:50:59Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
