Skip to content

Commit

Permalink
fix(gatsby-plugin-netlify-cms): automatic redirect (#9269)
Browse files Browse the repository at this point in the history
  • Loading branch information
c0b41 authored and geekysrm committed Oct 28, 2018
1 parent 4d5b8e7 commit c6dce1c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/gatsby-plugin-netlify-cms/src/gatsby-node.js
Expand Up @@ -146,3 +146,13 @@ exports.onCreateWebpackConfig = (
webpack(config).run()
}
}

exports.onPostBuild = ({ actions }, { publicPath = `admin` }) => {
const { createRedirect } = actions

createRedirect({
fromPath: `/${publicPath}`,
toPath: `/${publicPath}/`,
isPermanent: true,
})
}

0 comments on commit c6dce1c

Please sign in to comment.