-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Baseof.html in a theme is prioritized over non-theme peer equivalent #3505
Comments
Update: All cases work except #5 on v.021 (Downloaded to test). I'm not sure if case #5 is by design or a bug so I submit it here for comment. But I believe it should defer to any non-theme equivalent peer that exists. (Eg; if baseof.html is specified in both places, the non-theme variant should take preference) ~/Downloads/hh3/hugo version |
I assume this bug still persist in v25.1, or I am not sure of what is the default behavior. I overwrite Hugo will only prioritze
|
Hey.. yeah looks that way. I actually took a look at their go templates, but I'm not strong enough in go to debug it. It worked in V0.18 as I recall, but since then considerable work has gone in to support multiple output formats. I ended up just refactoring my code so that I work completely out of the theme directory. This repo was designed to show those cases. |
I think I came across this in v0.26 after following the quickstart:
Much frustration for a new user working out whats going on. I ended up hacking the theme files. |
+1 - I'm having the same issue. The build process will only use It seems to be related to which template is currently showing. I can setup the site and theme so that my To reproduceFollow the quick start instructions and then perform these steps:
|
+1, I also encountered this issue with Hugo 0.30 and found it quite confusing for a newbie like me. I guess the main question is: is the behavior considered correct?
|
I am also encountering this issue as well. Creating |
having the same issue, any update please? I do not know what to do except hacking the theme file... |
The tplimpl package was misusing the TemplateLookupDescriptor.WorkingDir field from the output package. By incorrectly setting it to the theme directory instead of the site root, the user is unable to override theme templates in some situations. Fixes gohugoio#3505
@shosanna I haven’t seen any updates yet, but a workaround is to copy the whole layouts folder from the theme to your site and then override the baseof.html. Because you have all of the templates in the site it’ll use your baseof.html by default. |
Add an additional test to "Variant 4, theme, use site base" to also test for the index.html base (from by testing of gohugoio#3505). Also add a "name" field to the test cases to make it easier to know which test is failing versus just getting a slice index.
The tplimpl package was misusing the TemplateLookupDescriptor.WorkingDir field from the output package. By incorrectly setting it to the theme directory instead of the site root, the user is unable to override theme templates in some situations. Fixes gohugoio#3505
Add an additional test to "Variant 4, theme, use site base" to also test for the index.html base (from by testing of #3505). Also add a "name" field to the test cases to make it easier to know which test is failing versus just getting a slice index.
The tplimpl package was misusing the TemplateLookupDescriptor.WorkingDir field from the output package. By incorrectly setting it to the theme directory instead of the site root, the user is unable to override theme templates in some situations. Fixes #3505
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
UPDATE: All cases work except #5 in V 0.21. (Case #5 works in V 0.19)
brew switch hugo 0.19
to flip back and forth to verify issue.Setup
To test: Rename files to simulate unavailability.
Expected Behaviour
Observed Behaviour
I tried all the 0.20 branches - same behaviour as 0.20.7. This same behaviour happens with sections, like blog, but index was easier to verify.
├── layouts
│ ├── Xindex.html
│ └── _default
│ └── baseof.html
├── static
│ └── css
│ └── styles-primary.css
└── themes
└── hyper
│ └── default.md
├── layouts
│ ├── _default
│ │ ├── Xbaseof.html
│ │ ├── list.html
│ │ └── single.html
│ ├── index.html
├── static
│ ├── css
│ │ └── styles-theme.css
└── theme.toml
The text was updated successfully, but these errors were encountered: