Skip to content

Instantly share code, notes, and snippets.

@Epotignano
Last active November 23, 2019 05:06
Show Gist options
  • Select an option

  • Save Epotignano/185f4a592ded2ad48f31216f777c1e74 to your computer and use it in GitHub Desktop.

Select an option

Save Epotignano/185f4a592ded2ad48f31216f777c1e74 to your computer and use it in GitHub Desktop.
gatsby-config for integrate Prismic and Gatsby Image
plugins: [
/**
Something else that you have in your config
**/
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
/**
Something else that you have in your config
**/
{
resolve: 'gatsby-source-prismic',
options: {
repositoryName: <your-prismic-repository>,
accessToken: <your-prismic-master-access-token>,
linkResolver: ({ node, key, value }) => doc => {
// Your link resolver
},
fetchLinks: [
// Your list of links
],
htmlSerializer: ({ node, key, value }) => (
type,
element,
content,
children,
) => {
// Your HTML serializer
},
schemas: {
// Your custom types mapped to schemas
},
lang: '*',
shouldNormalizeImage: ({ node, key, value }) => {
// Return true to normalize the image or false to skip.
},
},
/**
Something else that you have in your config
**/
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment