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.

Commit cec6a9f

Browse files
nikolaiberestevich-derivNikolai Berestevich
andauthored
nikolai.berestevich/fixredirection (#2539)
Co-authored-by: Nikolai Berestevich <[email protected]>
1 parent 73b692f commit cec6a9f

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

gatsby-node.js

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports.onCreatePage = ({ page, actions }) => {
1313
const is_responsible_trading = /responsible/g.test(page.path)
1414
const is_contact_us = /contact_us/g.test(page.path)
1515
const is_p2p = /responsible/g.test(page.path)
16-
const is_story = /story/g.test(page.path)
16+
const who_we_are = /who-we-are/g.test(page.path)
1717
const is_market = /markets/g.test(page.path)
1818
const is_cfds = /cfds/g.test(page.path)
1919

@@ -68,7 +68,7 @@ exports.onCreatePage = ({ page, actions }) => {
6868
})
6969
}
7070

71-
if (is_story) {
71+
if (who_we_are) {
7272
createRedirect({
7373
fromPath: `/about/`,
7474
toPath: `/who-we-are/`,
@@ -81,6 +81,30 @@ exports.onCreatePage = ({ page, actions }) => {
8181
redirectInBrowser: true,
8282
isPermanent: true,
8383
})
84+
createRedirect({
85+
fromPath: `/story/`,
86+
toPath: `/who-we-are/`,
87+
redirectInBrowser: true,
88+
isPermanent: true,
89+
})
90+
createRedirect({
91+
fromPath: `/story`,
92+
toPath: `/who-we-are/`,
93+
redirectInBrowser: true,
94+
isPermanent: true,
95+
})
96+
createRedirect({
97+
fromPath: `/leadership/`,
98+
toPath: `/who-we-are/`,
99+
redirectInBrowser: true,
100+
isPermanent: true,
101+
})
102+
createRedirect({
103+
fromPath: `/leadership`,
104+
toPath: `/who-we-are/`,
105+
redirectInBrowser: true,
106+
isPermanent: true,
107+
})
84108
}
85109

86110
if (is_market) {
@@ -212,7 +236,7 @@ exports.onCreatePage = ({ page, actions }) => {
212236
})
213237
}
214238

215-
if (is_story) {
239+
if (who_we_are) {
216240
createRedirect({
217241
fromPath: `/${lang}/about/`,
218242
toPath: `/${lang}/who-we-are/`,
@@ -225,6 +249,30 @@ exports.onCreatePage = ({ page, actions }) => {
225249
redirectInBrowser: true,
226250
isPermanent: true,
227251
})
252+
createRedirect({
253+
fromPath: `/${lang}/story/`,
254+
toPath: `/${lang}/who-we-are/`,
255+
redirectInBrowser: true,
256+
isPermanent: true,
257+
})
258+
createRedirect({
259+
fromPath: `/${lang}/story`,
260+
toPath: `/${lang}/who-we-are/`,
261+
redirectInBrowser: true,
262+
isPermanent: true,
263+
})
264+
createRedirect({
265+
fromPath: `/${lang}/leadership/`,
266+
toPath: `/${lang}/who-we-are/`,
267+
redirectInBrowser: true,
268+
isPermanent: true,
269+
})
270+
createRedirect({
271+
fromPath: `/${lang}/leadership`,
272+
toPath: `/${lang}/who-we-are/`,
273+
redirectInBrowser: true,
274+
isPermanent: true,
275+
})
228276
}
229277

230278
if (is_market) {

0 commit comments

Comments
 (0)