storyblok / gatsby-source-storyblok

Gatsby source plugin for building websites using the Storyblok headless CMS as a data source.
MIT License
43 stars 35 forks source link

Query for assets #56

Closed noVerity closed 1 year ago

noVerity commented 3 years ago

Are there any plans to allow querying for assets. With the image optimisations available in Gatsby it would be a shame not to use those on the images we are getting from Storyblok and we would like to avoid linking to an external host where possible.

I had a look at adding it myself, but it looks like assets are only available on the content management endpoints and not the cdn ones which would require different authorisation methods.

Currently I am using this https://gist.github.com/noVerity/064a905a25de2783ed1c28c397d6fe58 to get all the images and then rendering either a normal image or the Gatbsy image based on if I have a url or the image data, but using regular expression to parse some JSON doesn't seem ideal.

fcisio commented 3 years ago

I'd like to ride of @noVerity ! I also would like something like this, but more precisely, other CMS can be studied.

The idea would be to include sharp transformations to the asset queries. Then we would be able to use gatsby-plugin-image.

On their doc they talk about some CMS source plugin that can already do this.

Is this something that could happen?

As of now there isn't easy and modern ways to handle images with Storyblok and React/Gatsby

schabibi1 commented 1 year ago

We'll close this issue as we have received a newer & the same issue - #271 Please feel free to join or react to the newer issue if it's something you'd like to tell us.