Skip to content

Commit

Permalink
add redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbot committed Jul 31, 2019
1 parent b30bc95 commit 05c32d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const redirects = require('./redirects')

exports.createPages = ({actions: {createRedirect}}) => {
for (const [fromPath, toPath] of Object.entries(redirects)) {
console.warn(`[redirect] ${fromPath}${toPath}`)
createRedirect({fromPath, toPath, redirectInBrowser: true})
}
}
6 changes: 6 additions & 0 deletions redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const TEAM_PATH = '/about/#team'

module.exports = {
'/team': TEAM_PATH,
'/team/': TEAM_PATH
}

0 comments on commit 05c32d4

Please sign in to comment.