Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Mrtenz/gatsby-remark-static-images

Repository files navigation

gatsby-remark-static-images

Version License Travis CI

Deprecated

This plugin is deprecated and may not work properly with the latest version of Gatsby. You can use the official plugin gatsby-remark-copy-linked-files instead. which works mostly the same as this plugin.


Copy images in markdown without processing them. Can be used in combination with gatsby-remark-images to copy SVG and GIF files. Make sure to place this plugin after gatsby-remark-images.

Getting started

yarn add --dev gatsby-remark-static-images

Usage

// gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-transformer-remark',
    options: {
      plugins: [
        'gatsby-remark-static-images'
      ]
    }
  }
]

Options

imageName

This option lets you specify the output name for the image. It should be a function that takes a File node and returns the name of the image as a string.

Defaults to: (node) => ${node.name}-${node.internal.contentDigest}.${node.extension}.

Example

{
  resolve: 'gatsby-remark-static-images',
  options: {
    imageName: (node) => `${node.name}.${node.extension}`
  }
}

About

Copy images in markdown without processing them

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •