See https://gohugo.io/hugo-modules/configuration/#module-config-mounts.
When the
mounts
config was introduced in Hugo 0.56.0, we were careful to preserve the existingstaticDir
and similar configuration to make sure all existing sites just continued to work.
But you should not have both. So if you add a
mounts
section you should make it complete and remove the oldstaticDir
etc. settings.
That is immediately followed by this example:
[[module.mounts]]
source = "content"
target = "content"
[[module.mounts]]
source = "static"
target = "static"
[[module.mounts]]
source = "layouts"
target = "layouts"
[[module.mounts]]
source = "data"
target = "data"
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "i18n"
target = "i18n"
[[module.mounts]]
source = "archetypes"
target = "archetypes"
I cloned your repo, then edited your config.toml
:
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "./node_modules/lazysizes"
target = "assets/npmplugins/lazysizes"
Now it builds.
The documentation is a bit cryptic. What I think it means is:
- If you add a mount where the target root is
archetypes/
, the default mount ofarchetypeDir
is clobbered (ignored). - If you add a mount where the target root is
assets/
, the default mount ofassetDir
is clobbered (ignored). - If you add a mount where the target root is
content/
, the default mount ofcontentDir
is clobbered (ignored). - If you add a mount where the target root is
data/
, the default mount ofdataDir
is clobbered (ignored). - If you add a mount where the target root is
layouts/
, the default mount oflayoutDir
is clobbered (ignored). - If you add a mount where the target root is
static/
, the default mount ofstaticDir
is clobbered (ignored).