Head over to the gomplate docs or Hugo docs for details about those projects.
Please treat this as a Proof of Concept rather than a proper Tutorial. Probably not for absolute beginners.
A project demonstrating what happens when you combine gomplate
and hugo
.
I am using gomplate
to populate the /content/
directory from a datasource. Hugo does the rest.
Install hugo
and gomplate
. Refer to their respective documentation sites for details how.
Navigate to hugo-demo
and run gomplate
This will populate hugo-demo/content/posts/
with posts from https://jsonplaceholder.typicode.com/posts
.
Run hugo server
to see it as a Hugo website in action.
Navigate to gomplate-demo
and try the different config files:
gomplate --config api.yaml
This will populate outputs/api
with posts from https://jsonplaceholder.typicode.com/posts
.
Sample output can be found at sample-outputs/api/
gomplate --config localjson.yaml
This will populate outputs/localjson
with .md
posts from sources/datasource.json
.
Sample output can be found at sample-outputs/localjson/
gomplate --config localcsv.yaml
This will populate outputs/localcsv
with .md
posts from sources/datasource.csv
.
Sample output can be found at sample-outputs/localcsv/
Not a Hugo dev. Not a gomplate dev. Not really a Go dev at all.
Big thanks to the people behind Hugo and gomplate for developing these awesome products.
MIT.