Is there a way to read the content of a data file placed outside the /data directory?
Im organizing my project using the page bundles and would be awesome have data files in the same directory as the other resources as images or md files.
As far as i know, it’s only possible with JSON and CSV at the moment. See data-driven content docs
That’s specific to
getCSV functions. But you can have JSON/YAML/TOML data files in the site’s
data/ dir and have it read using
.Site.Data.foo (assuming the file base name is
foo) – recent example.
@cmal Sorry, I misunderstood the question… read too fast.
The OP said:
de /data directory?
So I was quick on the trigger to assume that this was a question about multi-language site (because “de”) and
I now see that you meant to say that you can read only JSON and CSV data files from outside
thank you guys! it works. Shame on me for not reading the docs properly.
if it helps someone, this post have helped me with an error after get “getJSON” working
Seriously hugo and this community are amazing, thanks to all the community and the devs for your work.