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.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
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
Hugo Static Site Generator v0.21 darwin/amd64 BuildDate: 2017-05-22T06:11:48-07:00
I assume this bug still persist in v25.1, or I am not sure of what is the default behavior.
I overwrite /layouts/_default/baseof.html expecting every page to have the same base, but it seems Hugo still prioritize the base from the theme /themes/xxx/layouts/_default/baseof.html.
Hugo will only prioritze /layouts/_default/baseof.html if I overwrite (the theme also contains _default/list.html and _default/single.html) the following as well
/layouts/_default/list.html/layouts/_default/single.htmlHey.. 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 layouts/_default/baseof.html if I overwrite other templates defined within the themes/themename/layouts/_default/ folder.
It seems to be related to which template is currently showing. I can setup the site and theme so that my baseof.html overrides are used on some pages but not others.
Follow the quick start instructions and then perform these steps:
themes/ananke/exampleSite/ to the main Hugo directory so there is some content to work with.themes/ananke/layouts/_default/baseof.html to layouts/_default/baseof.htmllayouts/_default/baseof.html in some way. I opted for adding a <h1>Testing</h1> after the opening <body> tag for easy debugging between pages.themes/ananke/layouts/_default/list.html to layouts/_default/list.html<h1> tag is present on the home page.<h1> tag is not present.themes/ananke/layouts/_default/single.html to layouts/_default/single.html<h1> tag is now present on the single post page due to the override of the single.html template.+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?
baseof.html, we also have to copy (in layouts/_default) several files we in fact don't plan to change at all.I am also encountering this issue as well. Creating baseof.html within layouts/_defaults does not override the theme layout. Any update?
having the same issue, any update please? I do not know what to do except hacking the theme file...
@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.
Most helpful comment
I am also encountering this issue as well. Creating
baseof.htmlwithinlayouts/_defaultsdoes not override the theme layout. Any update?