Modules includeFiles parameter work for data?

Hi,
I’m trying to pull in individual files with hugo modules. Here is my config:

[module]
  [[module.imports]]
    path = "github.com/chipsalliance/tsc"

  [[module.imports.mounts]]
    source = "workgroups"
    target = "content/workgroups"
    includeFiles = 'chisel.md'

  [[module.imports.mounts]]
    source = "projects"
    target = "data/projects"
    includeFiles = 'sv-tests.yml'

The first mount works, in that it pulls in just the chisel.md file successfully. The second mount does not work—sv-tests.yml does not get pulled in. Is there a restriction on where you can use includeFiles? Like maybe it doesn’t work for the “data” directory? Or am I doing something wrong?

Thanks.

There a known issue with data mounts: the object is available in the data root, not in the subdir specified by the mount.

This works:

{{ $d := index site.Data "sv-tests" }}
<pre>{{ jsonify (dict "indent" "  ") $d }}</pre>

https://github.com/gohugoio/hugo/issues/10681

You may already know this, but if you use underscores instead of hyphens in your file name you can do this if you want to hard code the object:

site.Data.sv_tests

instead of using the index function.

Thanks for the quick reply.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.