Closed Figumari closed 5 months ago
@Figumari the easiest solution would be to pass the image src directly to the gatsby-image-plugin (StaticImage) - have you tried it?
@arkgor I tried it and that does not work: https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-plugin-image#restrictions-on-using-staticimage
@arkgor I tried it and that does not work:
Yeah, only Dynamic images
(so input from GarphQL) accept props from the parent.
But, but we're already using a lot of that between Gatsby & Storyblok. I think we could replicate what's done with Dynamic images.
But at that point, this might be worth it to create a package gatsby-storyblok-image-plugin
.
Is there any update on this? gatsby-image
is officially deprecated.
@klattiation Not possible, It's a limitation from Storyblok.
But they should be working on an official "Storyblok Plugin for Gatsby Image Plugin".
It should be the next thing in their roadmap
@fcisio alright thanks!
We added some support for gatsby images in the 3.1.0
of gatsby source storyblok: https://github.com/storyblok/gatsby-source-storyblok
Hey everyone, following with @lisilinhart update above, I think we'd be all set for an upgrade.
I was thinking we could scratch pretty much all the current code, and simply extend the native gatsby-plugin-image
components.
Basically, we only need to use the CDN url when:
if (location.search.includes('_storyblok'))
That way, no CDN url should make it to the prod, and we still have images that work inside the editor.
We can also get additional values (width, height, ...) when fields are integrated via the V2 Editor. So we wouldn't need to get those props by dissecting the URL anymore.
I'll be drafting this on a project, then I can help with the implementation if needed 🎉
I am making an update to support gatsby-plugin-image, with typing support 😀
I am making an update to support gatsby-plugin-image, with typing support 😀
https://github.com/nonjene/gatsby-plugin-storyblok-image I have rewritten it based on this plugin with typescript.
Please add support for the new gatsby image plugin: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-image#readme