Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-storyblok-image

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-storyblok-image

Adds gatsby-plugin-image to Gatsby & Storyblok as a content source.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
280
increased by24.44%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-storyblok-image

Using TypeScript Tested with Jest

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 can be 'fixed' | 'constrained' | 'fullWidth'
    // see more: https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-plugin-image/#layout
    layout: 'fixed',
    
    // use width & height when layout is 'fixed' or 'constrained'
    width: 900,
    height: 900,
    
    // Optional:
    // quality: 100,
    // outputPixelDensities: [1, 2, 3], // for constrained default is [0.25, 0.5, 1, 2, 3]
    // breakpoints	[750, 1080, 1366, 1920], // for fullWidth or constrained
    // backgroundColor: 'transparent', // make the image like fixed object to contain instead of cover. Default not set.

    // Storyblok image service additional options:
    // smartCrop: true, // default true
  })

  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.

Keywords

FAQs

Package last updated on 20 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc