gatsby-plugin-storyblok-image
gatsby-plugin-storyblok-image let you use gatsby-plugin-image with Storyblok service v2.
Let you can create any dynamic content in the Storyblok CMS and get advantage with the optimized images outside of GraphQL static query.
Plugin write with Typescript. Props design to be gatsby-plugin-image liked.
Install
npm i gatsby-plugin-storyblok-image
or
yarn add gatsby-plugin-storyblok-image
Usage
import { GatsbyImage } from 'gatsby-plugin-image'
import { getGatsbyImageProps } from 'gatsby-plugin-storyblok-image'
export default function Image({ image }) {
const gatsbyImageData = getGatsbyImageProps(image, {
layout: 'fixed',
width: 900,
height: 900,
})
return (
<GatsbyImage {...gatsbyImageData} />
)
}
Credits
This plugin is the alternate of gatsby-storyblok-image, which is inspired by Sanity's way of implementing gatsby-image outside of GraphQL in their gatsby-source-sanity plugin.