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

frontmatter gallery images not transformed #32

Closed jacknevitt closed 4 years ago

jacknevitt commented 4 years ago

I hope this is the right place to share my issue. For arrays of image paths like my frontmatter gallery, the paths are not being transformed.

---
gallery:
- "/content/images/20160821_004637.jpg"
- "/content/images/20160524_221520.jpg"
hero_image: "/content/images/20160821_004637.jpg"
---

In the frontmatter above, the hero_image is transformed as expected but the gallery strings are left unchanged. My gatsby-config plugins are set up like so:

"gatsby-plugin-styled-components",
    `gatsby-plugin-react-helmet`,
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: "events",
        path: `${__dirname}/content/events`,
      },
    },
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: "images",
        path: `${__dirname}/content/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#663399`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
      },
    },
    {
      resolve: "gatsby-transformer-remark",
      options: {
        plugins: [
          "gatsby-remark-relative-images",
          "gatsby-remark-normalize-paths",
          {
            resolve: "gatsby-remark-images",
            options: {
              maxWidth: 1000,
              linkImagesToOriginal: false,
            },
          },
        ],
      },
    },

Any help would be appreciated, thanks!