See https://gohugo.io/hugo-modules/configuration/#module-config-mounts.
When the
mountsconfig was introduced in Hugo 0.56.0, we were careful to preserve the existingstaticDirand similar configuration to make sure all existing sites just continued to work.
But you should not have both. So if you add a
mountssection you should make it complete and remove the oldstaticDiretc. 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 ofarchetypeDiris clobbered (ignored). - If you add a mount where the target root is
assets/, the default mount ofassetDiris clobbered (ignored). - If you add a mount where the target root is
content/, the default mount ofcontentDiris clobbered (ignored). - If you add a mount where the target root is
data/, the default mount ofdataDiris clobbered (ignored). - If you add a mount where the target root is
layouts/, the default mount oflayoutDiris clobbered (ignored). - If you add a mount where the target root is
static/, the default mount ofstaticDiris clobbered (ignored).