I want to have two different
static directories with my project. From searching and reading the docs, I learned that this is possible with mounts.
This is my goal:
||Hugo virtual folder
I use this
- source: static
- source: content/assets
The problem is that I also have an
asset subdirectory in
static. So there are two:
With the above mount configuration, Hugo only renders
static/assets/. But the original
static/assets/ directory is ignored (or overwritten).
How do I tell Hugo to merge the
content/assets/ folder with the
static/assets/ folder I already have?
Could you also try to explicitly mount
static/assets on to
Sidenote: I assume you might have a
static directory in your
content directory because of some IDE complications with “path not found” and markdown previews? You probably can map those directories in the IDE instead of Hugo and keep everything in static.
Thanks, this fixes the situation. Not sure why I overlooked such an obvious things.
That could be but it’s not my setup. I have two repositories for my website, one for the content (which contains the
content/assets folders) and one that has all the other files (theme, Hugo config).
This way I have one repository for both my images and Markdown content files. (I know images could also live inside
content with page bundles, but I don’t like to clutter my subdirectories in
My 50 cents about this is that:
- Mount merges happens within a component type (e.g. static, content, assets, i18n etc.)
- Due to the processing order a /content/foo.jpg will win over /static/foo.jpg – but this has nothing to do with any mount merging
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.