Hi all,
I’m working on a new site using Hugo’s modules and theming support. I’ve divided my theme into a few modules:
- base
- blog
- photos
I also have a few additional themes that contribute specific small components.
Each of these modules has a collection of templates for their particular section, and I’ve set up mounts in the top-level hugo.yaml
file to place them in virtual subdirectories according to their section:
- path: base
- path: blog
mounts:
- source: assets
target: assets/blog
- source: layouts/_default
target: layouts/blog
I’ve mostly gotten the working since the layout templates in each section haven’t needed to use partials from their own theme or another theme. However, I’ve been working on a new theme component that does have a few partials that reference each other. It has some mounts like this:
- path: my-component
mounts:
- source: assets
target: assets/my-component
- source: layouts/partials
target: layouts/partials/my-component
The problem I’m running into is how to build a path to the correct partial template when the top-level site has moved it via a mount. Is there a way for the template to know this? Is this a good approach, or is there a better way to do this?
Thanks!