Hi,
I have a multilingual site and for each post I want to add some page resources, like images and data. The resources are language independent, only the content is in different languages.
The content directory structure looks like this:
content
| trekkings
| | tourbregaglia
| | | data.json
| | | index.de.md
| | | index.en.md
| | | index.nl.md
| | | map.jpg
Displaying a small version of the image ‘map.jpg’ is done using:
{{ $map := .Page.Resources.GetMatch (“map.jpg”) }}
<img src="{{ ($map.Fill “320x240”).RelPermalink }}">
That works perfectly and intuitively. No knowledge about the content directory or the different languages is needed.
But how do I access the data.json file?
The standard way, as described here will not work, since getJSON needs a path argument relative to Hugo’s workdir. Is there any way how read in the data.json, just by providing the relative path?
Thanks!
David