|
|
|
|
|
by lovelearning
2087 days ago
|
|
See https://gohugo.io/templates/data-templates/.
If data is SQL, a simple API server to serve up the data at generation-time is the preferred approach. Pelican and Hugo are the two generators I'm comfortable. Both have a plugin ecosystem - my guess is that something close already exists. Otherwise, Pelican source code is simple to understand and extend. If I were to implement this and if the data was static or changed only occasionally, I'd read my custom data source, add that data to the Jinja template variables and access them from Jinja HTML templates. For fast changing data, I agree with the export to JSON and render from Javascript approach already suggested. |
|