Skip to content

block templates can not be overridden on their own #2783

@ebr

Description

@ebr

Relevant discussion here: https://discuss.gohugo.io/t/block-templates-outside-of-a-theme/4806
Repro case here: https://github.com/ebr/hugo-example

Summary:

templates that use blocks (e.g. baseof.html) cannot be overridden on their own. They require the sub-templates (ones that define blocks) to be also present in the project.

Steps to reproduce:

  • create a theme using block templates, e.g ./theme/layouts/_default/baseof.html, ./theme/layouts/index.html, where index.html defines a block that is used in baseof.html
  • copy baseof.html to ./layouts/_default/ (out of the theme and up into the project)
  • delete baseof.html in the theme

Result:

  • rendered index.html is blank. the base template isn't finding the index.html block template.

Expected:

  • baseof.html should use the relevant template from the theme.

Version:

Hugo 0.18-DEV

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions