Custom list.html and single.html for each folder


#1

Hello;

i am working on medium scale web site, and i want to have custom display for each folder.
for example i have two main web folder :

-> FUE
|
-> handmade
|
-> _index.md
-> page1.md
-> page2.md
-> robotic
|
-> _index.md
-> page1.md
-> page2.md
-> hair
|
-> _index.md
-> page1.md

In my layout folder i have this folder tree:

-> FUE
|
->list.html
->single.html

-> hair
–>list.html
–>single.html

So i want to have the same display layout for “homemade” and “robotic” . “hair” folder is destinated to have different layout.

So when i get the pages urls /handmade ou /robotic the FUE/list.html is used, but when i get to /hair the title is got from _index.md, and no content is dispalyed, i have to use /hair/page1/ to get the content of page1 displayed.

How can i make this work fine please? i mean to display correctly when using /hair url

Best regards


#2

Please have a look at Hugo’s Layouts Lookup Order:

If the above does not clear things up, you will need to provide a link to a repository with your Hugo project’s source code for people to see what’s going on.