Skip to content

libsrcdev/gatsby-remark-structured-content

Repository files navigation

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-content

Capatibilities

  • 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
          },
        },
      ],
    },
  },
];

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published