HUGO

Hugo Module Mounts: use root file as source

Hello!

I’m trying to mount netlify.toml file as part of the data directory so Hugo can access its variables and potentially use them (make sure Hugo.version is on parr with Netlify’s settings etc…)

module:
  mounts:
    - source: netlify.toml
      target: data/netlify_config.toml

The above config produces the following message:

Error: add site dependencies: create deps: create PathSpec: build filesystems: this fs supports directories only

I tried prepending the file with / (- source: /netlify.toml) but then the mount does not work.

Anybody has experience mounting root files? Am I missing something?

Thanks a ton!

I think you stumbled upon a limitation of the /data folder (I. could explain the why, but just leave that for a later time). I suggest you mount it inside /assets and then use ´transform.Unmarshal` to parse it.

1 Like