grav-plugin-api icon indicating copy to clipboard operation
grav-plugin-api copied to clipboard

feat: managing site media

Open Regaez opened this issue 5 years ago • 2 comments

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 avatar Aug 05 '19 22:08 Regaez

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:

  • POST /api/media, or
  • POST /api/images, or
  • POST /api/data

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 avatar Apr 09 '20 07:04 Regaez

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.

Regaez avatar Apr 09 '20 07:04 Regaez