# Modules includeFiles parameter work for data?

**URL:** <https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495>\
**Category:** support\
**Tags:** modules\
**Created:** [March 17, 2023, 6:14pm UTC](https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495 "2023-03-17T18:14:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjyabraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cjyabraham/32/19032_2.png) [@cjyabraham](https://discourse.gohugo.io/u/cjyabraham)\
**Post date:** [March 17, 2023, 6:14pm UTC](https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495/1 "2023-03-17T18:14:42Z")

</div>

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

```auto
[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.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 17, 2023, 6:33pm UTC](https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495/2 "2023-03-17T18:33:04Z")

</div>

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:

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

```

[https://github.com/gohugoio/hugo/issues/10681](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:

```auto
site.Data.sv_tests

```

instead of using the `index` function.

---

<div class="post-metadata">

**Author:** ![cjyabraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cjyabraham/32/19032_2.png) [@cjyabraham](https://discourse.gohugo.io/u/cjyabraham)\
**Post date:** [March 17, 2023, 6:39pm UTC](https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495/3 "2023-03-17T18:39:58Z")

</div>

Thanks for the quick reply.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [March 19, 2023, 6:40pm UTC](https://discourse.gohugo.io/t/modules-includefiles-parameter-work-for-data/43495/4 "2023-03-19T18:40:09Z")

</div>

Closed on March 19, 2023, 6:40pm UTC

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