Closed tomcam closed 6 years ago
Perfect. Thank you.
I'm super impressed at how I totally missed your Go client, which is just fantastic. Not too many people can be as dimwitted as I am. Thanks again for pointing me at it.
@tomcam - thank you for the kind words, I'm glad you like it.
Haha it happens! I should update the docs to point to the Go client.. it had been in "Work in progress" state for a while, but it's solid enough now to put front and center.
If you have any issues while use the client, please let me know on the repo, or join us on the #Ponzu slack channel here: https://gophers.slack.com/messages/C3TBV356D
Thanks 👍
Hi @tomcam - Ponzu is only responsible for managing data/content in its CMS, and responding to API requests for that data in JSON form.
You could create an index.html file and host it anywhere, loading your data from Ponzu via ajax/xhr or have another server make http requests before it responds.
Are you familiar with any Go web frameworks? Or any web frameworks in other languages? If not, I would suggest exploring how to define routes and start a web server in Go. You can add any number of routes using the standard http mux in Go, or use a more feature-rich router mounted to the standard router used by Ponzu.
The simplest way to get started would be to add this to one of your generated content files in the
content
directory of you Ponzu project:This way, you are adding a route to the same default http mux (router) exposed by the Go standard library. This is the same router Ponzu uses internally to manage http requests.
Using the same approach, you can look at the
html/template
package to write templates which you would load your data into.Lastly, I would consider using the official Ponzu Go client (https://github.com/ponzu-cms/go-client) - there are examples in the README to get started.