This plugin extracts images from markdown files that are parsed with gatsby-transformer-remark.
npm i --save @libsrcdev/gatsby-remark-structured-content- List embedded images of markdown content based on custom logic.
- Remove embedded images of markdown content based on custom logic.
- Extract the first embedded image to use it as a thumbnail.
- Create a gallery of all images used in a post.
Example:
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-structured-content`,
options: {
// You can optionally provide a function to infer language from code block content when language is not specified
shouldExtractImage: async (code) => { ... }, // Optional
},
},
],
},
},
];