Hi there, I’m using a Go wrapper script to pull in some external data and process it before building my site with Hugo, as well as for some linting, a deploy option etc.
For calling hugo server and hugo deploy from Go, I’m using the Execute function from github.com/gohugoio/hugo/commands, that works great.
But now, I’d like to read in some config values. I could call hugo config with the same Execute function, but the problem is that Execute only returns an error (or nil), and the output, which I need, ends up in the standard output.
My questions are as follows:
- Is using the
Executefunction the recommended way to get the config, or should I usegithub.com/gohugoio/hugo/config/allconfigsomehow? - If
Executeis the way to go, how do I get the output? Could you perhaps add anio.Writeror similar as argument toExecute, that Hugo can write its output to?
Thank you and best, Ruben