You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
This commit fixes the base template lookup order to match the behaviour of regular templates.
```
1. <current-path>/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
2. <current-path>/baseof.<suffix>
3. _default/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
4. _default/baseof.<suffix>
For each of the steps above, it will first look in the project, then, if theme is set,
in the theme's layouts folder.
```
Fixesgohugoio#2783
This commit fixes the base template lookup order to match the behaviour of regular templates.
```
1. <current-path>/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
2. <current-path>/baseof.<suffix>
3. _default/<template-name>-baseof.<suffix>, e.g. list-baseof.<suffix>.
4. _default/baseof.<suffix>
For each of the steps above, it will first look in the project, then, if theme is set,
in the theme's layouts folder.
```
Fixes#2783
bep
added a commit
to bep/hugo
that referenced
this issue
Dec 15, 2016
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:
./theme/layouts/_default/baseof.html
,./theme/layouts/index.html
, whereindex.html
defines a block that is used inbaseof.html
baseof.html
to./layouts/_default/
(out of the theme and up into the project)baseof.html
in the themeResult:
index.html
is blank. the base template isn't finding theindex.html
block template.Expected:
baseof.html
should use the relevant template from the theme.Version:
Hugo 0.18-DEV
The text was updated successfully, but these errors were encountered: