Gatsby | Support for gatsby-image on Rich Text fields

While I can set up gatsby-image on dedicated image fields, is there any way I can set up gatsby-image on the Images that are on Rich Text Fields?

I’m using:
“gatsby”: “^2.21.21”,
“gatsby-image”: “^2.4.3”,
“prismic-reactjs”: “^1.3.1”,
“gatsby-source-prismic-graphql”: “^3.6.2”,

Hi,

Sorry for the delay with the reply.

If you want make any changes to how images in rich text are handled, then you need to do this in the HTMLSerialzer. You can read about this here:
https://prismic.io/docs/reactjs/beyond-the-api/html-serializer

What is your use case for gatsby-image in your project? If it’s for image processing, then did you know that all your images are coming pre-optimised from Prismic with our Imgix integration?

Check it out, it might save you re-doing a lot of work.

Thanks.

1 Like

I’m using it for a blog at https://www.watchcookie.com/ and I just needed it for image optimization, if they come pre-optimized then then there’s nothing I need to do.

1 Like

A post was split to a new topic: Gatsby Lazy Loading and trace svg