@libsrcdev/gatsby-remark-structured-content
v0.1.13
Published
This plugin helps building thumbnails, covers, heros, carousel features from remark content.
Downloads
537
Maintainers
Readme
gatsby-remark-structured-content
This plugin extracts images from markdown files that are parsed with gatsby-transformer-remark.
How to install
npm i --save @libsrcdev/gatsby-remark-structured-contentCapatibilities
- List embedded images of markdown content based on custom logic.
- Remove embedded images of markdown content based on custom logic.
Usecases
- Extract the first embedded image to use it as a thumbnail.
- Create a gallery of all images used in a post.
Usage
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
},
},
],
},
},
];