I’m quite new to go and am currently tinkering with Hugo. I have an idea for a project which would require me to access data from a database. I’ve seen this possibility mentioned in Issue #450.
How should I tackle that best? Write an export script to write the data into a yaml (which somehow looks hacky and error prone to me) and then iterate over it or should I try to find a solution to access my DB directly? Would be grateful for every hint or piece of advice.
Hugo will support static data models soon… These are just YAML/JSON/TOML files in the site source directory. I could eventually see direct DB access, but it won’t be soon. There’s not much motivation for doing so since the destination isn’t dynamic, but static as @bjornerik said.
Data in data/jazz/bass/jacopastorius.toml is accessible through Site, so every node can access it through that map in a template?
Is there a way to pass that map to a template? Could I, for example, assign it to Scratch and then use it in a template? The use case is “user wants to pass datasets for different artists to that template” and the artists are stored in separate files.