danielmahon / gatsby-remark-relative-images

Convert markdown image src(s) to be relative for gatsby-remark-images.
https://www.npmjs.com/package/gatsby-remark-relative-images
BSD Zero Clause License
79 stars 29 forks source link

Images not found with version 2 #51

Open AndrewTraub opened 3 years ago

AndrewTraub commented 3 years ago

I'm using netlify and have followed your instructions but the images are not found.

Here is my gatsby-config:

module.exports = {
  plugins: [
    'gatsby-plugin-react-helmet',
    'gatsby-transformer-yaml',
    {
      resolve: 'gatsby-plugin-google-tagmanager',
      options: ...
    },
    {
      resolve: 'gatsby-plugin-offline',
      options: ...
    },
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        ...
      }
    },
    // Add static assets before markdown files and images
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        path: `${__dirname}/static/assets`,
        name: 'images'
      }
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        path: `${__dirname}/content`,
        name: 'pages'
      }
    },
    // images
    'gatsby-plugin-image',
    'gatsby-plugin-sharp',
    'gatsby-transformer-sharp',
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          // gatsby-remark-relative-images must
          // go before gatsby-remark-images
          'gatsby-remark-relative-images',
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 800,
              linkImagesToOriginal: false
            }
          },
          `gatsby-remark-responsive-iframe`
        ]
      }
    },
    {
      resolve: `@leomanlapera/gatsby-source-yelp`,
      options: {
        ...
      }
    },
    {
      resolve: 'gatsby-plugin-nprogress',
      options: {
        ...
      }
    },
    'gatsby-plugin-sitemap',
    {
      resolve: 'gatsby-plugin-netlify-cms',
      options: {
        ...
      }
    },
    'gatsby-plugin-netlify' // make sure to keep it last in the array
  ]
}
AndrewTraub commented 3 years ago

It works with version 0.3 but not 2.x and 1.1