Skip to content

Fix base template lookup order for sections #2995

@dmitriid

Description

@dmitriid

What's happening

(also see img below)

This happens on both Hugo 0.18.1 and Hugo 0.19-DEV. Didn't happen on Hugo 0.18-DEV

I have a theme, with default layouts defined as follows: ./themes/freja/layouts/_default/{baseof,list,single}.html

For the gen section of the website I've overriden all of them:
./themes/freja/layouts/gen/{baseof,list,single}.html

And now the section's baseof template isn't used.

Screenshot of the file tree:

./themes/freja/layouts/_default/baseof.html is a regular html file:

<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
...
<body>
<main>
  {{ block "main" . }}
  {{ end }}
</main>
</body>
</html>

whereas ./themes/freja/layouts/gen/baseof.html is just a shell:

{{ block "main" . }}

{{ end }}

The rest of the templates are quite similar.

The result for /gen should look like this: https://dmitriid.com/gen/social/ Now, however, the output is surrounded by HTML from the theme's default baseof.html

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions