gatsby-remark-images is a Gatsby plugin designed to enhance markdown-embedded images, making them responsive and optimized for production builds. It functions by processing images within markdown files through `gatsby-transformer-remark`, generating multiple width versions and setting `srcset` and `sizes` attributes for efficient, bandwidth-aware loading. A key feature is its "blur-up" technique, which uses a small, lightweight placeholder image that quickly loads and then transitions to the full-resolution image, improving perceived performance and preventing layout shifts. The plugin is currently at version `7.16.0` and is an integral part of the actively maintained Gatsby ecosystem, with updates often coinciding with new Gatsby framework releases. It critically depends on `gatsby-plugin-sharp` for its underlying image processing capabilities, enabling advanced optimizations like WebP conversion and quality compression.
npm install gatsby-remark-imagesVerified import paths — ran on the pinned version, not inferred.
This configuration snippet shows how to integrate `gatsby-remark-images` into your `gatsby-config.js`. It enables responsive image processing for markdown files, leveraging `gatsby-plugin-sharp` and setting a `maxWidth` for optimized image generation.
Upgrade Node.js to version 18.0.0 or higher. For Gatsby v5, ensure Node.js is within the `>=18.0.0 <26` range specified by the package's engines.
Ensure your project's `package.json` specifies `gatsby: ^5.0.0-next` and `gatsby-plugin-sharp: ^5.0.0-next`. Upgrade Gatsby and `gatsby-plugin-sharp` if necessary.
Verify `gatsby-plugin-sharp` is installed (`npm install gatsby-plugin-sharp`) and correctly listed in `gatsby-config.js` *before* `gatsby-transformer-remark` and `gatsby-remark-images`.
Carefully determine the `maxWidth` for your content area and configure it in `gatsby-config.js` options for `gatsby-remark-images`. For example: `options: { maxWidth: 800 }`.Ensure all images intended for processing are stored locally within your project and referenced using paths relative to the markdown file they are embedded in. For external images, consider `gatsby-remark-external-links` or similar plugins.
Regularly update `gatsby`, `gatsby-plugin-sharp`, and `gatsby-remark-images` to their latest stable versions to benefit from security patches and performance improvements.
Ensure you have `gatsby-remark-images` and `gatsby-transformer-remark` installed (`npm install gatsby-remark-images gatsby-transformer-remark`) and correctly configured in your `gatsby-config.js` under the `plugins` array.
Verify `gatsby-plugin-sharp` is installed (`npm install gatsby-plugin-sharp`) and configured *before* `gatsby-transformer-remark` in your `gatsby-config.js`.
Upgrade your Node.js environment to a supported version. For Gatsby v5, this typically means Node.js 18 or higher. Use a version manager like `nvm` (`nvm install 18 && nvm use 18`) to manage Node.js versions.
Double-check your `gatsby-config.js` for `gatsby-remark-images` options, especially `maxWidth`. Ensure markdown image paths are relative. Also, inspect your browser's developer tools for any CSS overrides that might be affecting the plugin's generated image wrappers.