Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-replace-paths

npm

A Gatsby plugin to replace page paths.

Installation

Yarn

$ yarn add --dev gatsby-plugin-replace-paths

npm

$ npm install --save-dev gatsby-plugin-replace-paths

Usage

// gatsby-config.js

module.exports = {
  // ...
  plugins: [
    {
      resolve: "gatsby-plugin-replace-paths",
      options: {
        config: [
          {
            pattern: "/about",
            replacement: "/a-propos",
          },
          {
            pattern: /(e)/g,
            replacement: (_, match) => match.toUpperCase(),
          },
        ],
      },
    },
  ],
};

License

MIT © Maxime Blanc Fork of Neil Kistner

© 2023 Gatsby, Inc.