Automatically modify backend branch for NetlifyCMS
This plugin automatically update config.yml
so that backend.branch is the same with your current git branch.
This plugin will also
- only runs in development
- only modify config.yml the first time you run
gatsby develop
in a new branch
Install
yarn add gatsby-plugin-netlifycms-auto-branch
# sorry about the long name
Usage
// gatsby-config.js
module.exports = {
plugins: [
// use default setting
`gatsby-plugin-netlifycms-auto-branch`,
// or pass in a custom path to your config
{
resolve: `gatsby-plugin-netlifycms-auto-branch`,
options: {
pathToConfig: 'static/admin/config.yml',
},
},
]
}