Is it possible to use this plugin with static images? #39
-
Have just started using this plugin but I'm still needing to use gatsby-plugin-image for static images. There's no particular problem with this but it does add a whole bunch of extra divs which this plugin does not. Or should I be using a "static" folder in sanity somewhere for these images? Would appreciate your advice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I typically avoid shipping raster images in my app repository. Adding them to Sanity has a number of benefits, including the Image API and automatic edge CDN caching/serving, and it keeps the repository lighter. Alas, since this plugin leverages the Sanity Image API, there's not a way to work with local images directly. If you wanted to do something like this, I would recommend forking the plugin and revising it slightly to use Imgix with your website as the source. Sanity and Imgix have very similar APIs for transformations, so this should be somewhat straightforward. |
Beta Was this translation helpful? Give feedback.
I typically avoid shipping raster images in my app repository. Adding them to Sanity has a number of benefits, including the Image API and automatic edge CDN caching/serving, and it keeps the repository lighter.
Alas, since this plugin leverages the Sanity Image API, there's not a way to work with local images directly. If you wanted to do something like this, I would recommend forking the plugin and revising it slightly to use Imgix with your website as the source. Sanity and Imgix have very similar APIs for transformations, so this should be somewhat straightforward.