# Override of a specific index.html

**URL:** <https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618>\
**Category:** support\
**Created:** [July 21, 2022, 1:43am UTC](https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618 "2022-07-21T01:43:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hernies](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hernies/32/17363_2.png) [@Hernies](https://discourse.gohugo.io/u/Hernies)\
**Post date:** [July 21, 2022, 1:43am UTC](https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618/1 "2022-07-21T01:43:01Z")

</div>

Hi!  
I’m trying to selectively override risottos default layout for lists. I want to format my /posts/\_index.md in my own way. But without overriding the rest of the indexes. I’ve read up on [hugo’s lookup order](https://gohugo.io/templates/lookup-order/) which seems the most relevant document regarding my question. But I cannot find a solution to my issue.

I’ve thought of using hugo’s variables and create a generic index that will only “override” (aka format an index differently) if some conditions are met (page is an index && page is a post).  
But I cannot help but wonder if some solution such as creating a folder inside layout that would contain said specific index.html would be enough, ie:  
If content/posts is my directory it would look like: …/themes/layout/posts/index.html.

I quite recently became a user so I’m reading on lots of documentation but I couldnt find out an answer anywhere. I’ve also tried to implement it on my own but didnt manage to do it correctly (it compiled but my results werent satisfactory). I also tried following the [List Pages Templates](https://gohugo.io/templates/lists/) tutorial but it too wasnt what I wanted to do.  
I hope I explained myself clearly and my question wasn’t too basic, thank you for reading!

---

<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:** [July 21, 2022, 1:56am UTC](https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618/2 "2022-07-21T01:56:00Z")

</div>

Create layouts/posts/list.html to override the posts section page.

---

<div class="post-metadata">

**Author:** ![Hernies](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hernies/32/17363_2.png) [@Hernies](https://discourse.gohugo.io/u/Hernies)\
**Post date:** [July 21, 2022, 1:59am UTC](https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618/3 "2022-07-21T01:59:49Z")

</div>

Thank you so much! You have no idea how much time I’ve spent scratching my head on this.

---

<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:** [July 23, 2022, 2:00am UTC](https://discourse.gohugo.io/t/override-of-a-specific-index-html/39618/4 "2022-07-23T02:00:31Z")

</div>

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