Gatsby remark plugin to find and replace text.
Install
npm install --save gatsby-remark-find-replace
How to use
plugins: [
'gatsby-plugin-sharp',
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-find-replace',
options: {
replacements: {
COMPANY: 'My Company',
COPYRIGHT: `Copyright ${new Date().getFullYear()} My Company`,
},
prefix: '%',
},
},
],
},
},
]
Example
# My Special Blog Post
Welcome to %COMPANY's new blog! Please do not copy this post.
%COPYRIGHT
Turns into…
# My Special Blog Post
Welcome to My Company's new blog! Please do not copy this post.
Copyright 2019 My Company