Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

nikolai.berestevich/fixredirection #2539

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports.onCreatePage = ({ page, actions }) => {
const is_responsible_trading = /responsible/g.test(page.path)
const is_contact_us = /contact_us/g.test(page.path)
const is_p2p = /responsible/g.test(page.path)
const is_story = /story/g.test(page.path)
const who_we_are = /who-we-are/g.test(page.path)
const is_market = /markets/g.test(page.path)
const is_cfds = /cfds/g.test(page.path)

Expand Down Expand Up @@ -68,7 +68,7 @@ exports.onCreatePage = ({ page, actions }) => {
})
}

if (is_story) {
if (who_we_are) {
createRedirect({
fromPath: `/about/`,
toPath: `/who-we-are/`,
Expand All @@ -81,6 +81,30 @@ exports.onCreatePage = ({ page, actions }) => {
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/story/`,
toPath: `/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/story`,
toPath: `/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/leadership/`,
toPath: `/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/leadership`,
toPath: `/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
}

if (is_market) {
Expand Down Expand Up @@ -212,7 +236,7 @@ exports.onCreatePage = ({ page, actions }) => {
})
}

if (is_story) {
if (who_we_are) {
createRedirect({
fromPath: `/${lang}/about/`,
toPath: `/${lang}/who-we-are/`,
Expand All @@ -225,6 +249,30 @@ exports.onCreatePage = ({ page, actions }) => {
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/${lang}/story/`,
toPath: `/${lang}/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/${lang}/story`,
toPath: `/${lang}/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/${lang}/leadership/`,
toPath: `/${lang}/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
createRedirect({
fromPath: `/${lang}/leadership`,
toPath: `/${lang}/who-we-are/`,
redirectInBrowser: true,
isPermanent: true,
})
}

if (is_market) {
Expand Down