Regaez / grav-plugin-api

A REST API plugin for GravCMS
MIT License
27 stars 6 forks source link

feat: managing site media #13

Open Regaez opened 5 years ago

Regaez commented 5 years ago

How should the API manage site media? Should there be another endpoint that will allow uploading/deleting images etc?

Need to investigate how Grav internally handles media.

Regaez commented 4 years ago

Currently, there is no way to upload media such as images/pdfs etc to a page. The /pages endpoint does not allow this. A separate resource could be useful to separate the media from the page's header/content data. Perhaps an endpoint such as:

It could be great if a user could create/edit media metafiles via this endpoint, too. See Grav docs for more info regarding metafiles: https://learn.getgrav.org/16/content/media#metafiles

Regaez commented 4 years ago

I think /api/media would probably be better, as there are a variety of media types supported by Grav -- an endpoint of /api/images would not accurately reflect that.