I’m trying to create different “page.html” templates for different sections.
Starting with my about page, I added {“layout”: “about”,…}and then created a subdirectory in my layouts folder layouts/page/about.htmlwhich worked fine.
Then I added {“layout”: “event”, …}to the bulk of the content files and put the template file in layouts/page/event.htmlwhich caused an error
WARN found no layout file for “html” for layout “event” for kind “page”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
Moving the template event.html directly into the layouts directory rather than putting it in the page subdirectory sorted this problem.
But I’m still completely confused how one should organise the layouts directory. I know there’s a transition to moving basic templates from layouts/_default to directly in layouts/, but I’d like to organise by templates by section. I have no idea if the best practice is layouts/section_name/page.html etc or layouts/page/section_name.html, and also why this works for some and not others.
A difference between the about page is it’s in content/about/index.md whereas the event pages are in content/section_name/page_name/index.md, but their “kind” is both page.