Base template lookup order for sections

Based on the discussion in this issue #2995

This is the repo where you can see this behaviour: https://github.com/dmitriid/dmitriid.com

The full description is in the issue, here’s a condensed version:

I use a custom theme, where the theme’s layout is described in /themes/freja/_default/{baseof,single,list}.html

For a specific section of the site (called gen) I want to fully override the layout of the site. For this I have /themes/freja/section/{gen,gen-baseof}.html

Observed behaviour:

The generated file for a single entry (accessible in browser from http://localhost:1313/gen/social/) still has the outer shell from _default/baseof.html and _default/single.html

The generated file for “section list” (accessible in browser from localhost:1313/gen/) gets its outer shell from _default/baseof.html and everything else from section/gen.html

And here’s the link to the issue: https://github.com/spf13/hugo/issues/2995

What is your question?

The same as in the issue: the layout for the section used to override the default layout, now it doesn’t. How do I make sure section layout overrides default layout?

Also, as per your request in the issue: “Take this further on the discussion forum (start a new thread, and please post a reference to a full source repo that demonstrates your issue).”