readFile from module mount

I am trying to solve the following with Hugo Modules:

  • Read a file as string from another github repository.

Here’s my module import and mount


The partial reads the file like this:

{{ $string = readFile "data/docker/" }}

This produces the error

error calling readFile: file "data/docker/" does not exist

With target="content/docker" and readFile "docker/ the file is read successfully. However the content folder is surely not the right place for non-content data.

Is this a bug or is readFile not supposed to work with module mounts?