Similar to this topic … I’m encountering a similarly surprising behavior that I am unsure is expected or not.
if using multiple themes, IE: as articulated here in issue 4460 configuring them via hugo.yaml
:
config/_default/hugo.yaml
:
#config/_default/hugo.yaml
# ...
header:
layout: "grace"
# ...
theme:
- `customacmewrapper`
- `acmethemebase`
it seems like there’s some odd behavior.
say, for example, in acmethemebase
there’s a logic loop that looks for a template/partial and falls back to a default partial template if the file doesn’t exist
themes/acmethemebase/layouts/_default/baseof.html
:
{{- /* ... */ -}}}
{{ $header := print "header/" .Site.Params.header.layout ".html" }}
{{ if templates.Exists ( printf "partials/%s" $header ) }}
{{ partial $header . }}
{{ else }}
{{ partial "header/basic.html" . }}
{{ end }}
{{- /* ... */ -}}}
mysite # ls -A \
themes/acmethemebase/layouts/partials/header/ \
themes/customacmewrapper/layouts/partials/header/ \
layouts/partials/header/
layouts/partials/header/:
nograce.html
themes/acmethemebase/layouts/partials/header/:
basic.html hamburger.html hybrid.html
themes/customacmewrapper/layouts/partials/header/:
grace.html
it seems as if hugo doesn’t find the wrapper theme’s partial…grace
when assessing if the template defined in settings exists … instead falling through and including header/basic.html
in 0.145.x and previous, the lookup merge order was roughly
(current site layouts/...)
`-> (customacmewrapper/layouts/...)
`-> (acmethemebase/layouts/...)
`-> (embedded layouts || templates || partials etc)
now, it seems like the lookup for templates.Exists
is scoped… very differently …
I’m not quite sure what the “as intended” behavior is here, but it’s certainly a deviation from 0.145.x
behavior.
Is multiple theme composition no longer a supported pattern?
I can’t share a repo that demonstrates this at the moment
I have spent the last several days trying to adapt the upstream theme, and my own wrapper, to the changes in 0.146.x … just to get to a point where I could build my site again so I could make a post about something completely unrelated… only to hit this…
This came as a pretty big surprise to me..
So…
SHOULD this work still?
If it’s SUPPOSED to work, and it’s a bug, I can try to piece together an exemplar illustrating the problem,
But I don’t want to go thru the effort if the answer is going to be a Don't do that
I’m admittedly pretty frustrated, and am sincerely trying to not come across as snarky…
I know we all have lots going on; and this IS just software…
Is this another deprecated pattern and I’m jus really doin-it-wrong across myriad dimensions?
that sorta pain’s usually reserved for tuesdays …