Override of a specific index.html

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 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 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!

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

1 Like

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

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