ponzu-cms / ponzu

Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
https://docs.ponzu-cms.org
BSD 3-Clause "New" or "Revised" License
5.7k stars 385 forks source link

Where do generated HTML files go? #234

Closed tomcam closed 6 years ago

tomcam commented 6 years ago

When I look at the upload directories such as http://localhost:8080/api/uploads/2018/03/1522124717- they are empty, and I get 404s. For example, I created an article type like this:

$ ponzu gen content article title:"string" description:"string":richtext 
$ ~/go/bin/ponzu build
$ ~/go/bin/ponzu run

But nothing appears to be in those upload directories.

tomcam commented 6 years ago

Rewatched the video and saw I needed to do something like this:

http://localhost:8080/api/contents?type=Article And I see I can view the JSON data like this:

localhost:8080/api/content?type=Article&id=1

Am I responsible for generating HTML from the JSON record, or is there way to render HTML instead of JSON?

nilslice commented 6 years ago

@tomcam - my comment to your issue #235 may add some context to this. But, you are responsible to write the code to show your data in a structured presentation format. HTML is one, but being simply a JSON API, Ponzu can send your data to you mobile app, website, TV app, etc, all using the same server.

Ponzu has no notion of "themes" or any kind of front-end, which adds a lot of flexibility to your end project, but does require a bit more work than something like Wordpress or Drupal which come with the front-end bundled in.

Does that make sense? I apologize if I'm skipping over some detail here.

tomcam commented 6 years ago

It all makes absolute sense. Once you said said in issue #235, everything fell into place.

Ponzu is only responsible for managing data/content in its CMS, and responding to API requests for that data in JSON form.

Your sample code was the cherry on top and I greatly appreciate your answers! Thanks tons.