Modules includeFiles parameter work for data?

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

    path = ""

    source = "workgroups"
    target = "content/workgroups"
    includeFiles = ''

    source = "projects"
    target = "data/projects"
    includeFiles = 'sv-tests.yml'

The first mount works, in that it pulls in just the 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?


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>

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:


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.