I think this question is related to How to include the "next" partial in the search path?. That solved the case extending exactly one theme once, but how do I layer themes?
Specifically, what I’m trying to do is a setup of:
[site specific] --> [optional theme variant] --> [base theme]
In this case both the specific site, the variant, and the base theme all need to include things in the <script>
tag in the footer. The base theme provides an empty partials/foot-extra
to allow extension, but this only allows either the variant or the specific site to overwrite the foot-extra. I could solve this by having the optional middle layer overwrite partials/foot-extra
and have that include a partials/foot-extra2
which the base site can overwrite, but then if I later remove the middle layer, nothing will include foot-extra2
, and the site will break.
What is the design pattern in Hugo for optional middle layers?