Skip to content

Commit

Permalink
chore: switch to simple splat redirect for blog
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jun 26, 2023
1 parent c490e86 commit 8d4a8a2
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions gatsby-node.js
Expand Up @@ -88,22 +88,39 @@ function getMobileNetworkRedirects() {
}

function getBlogRedirects() {
const articles = [
'2021/07/18/welcome',
'2021/07/20/introduction-to-4g-and-lte',
'2021/07/24/lte-bands-and-duplex-modes',
'2021/08/04/mast-sectorisation-radiation-and-deployment-patterns',
'2021/08/21/ofdm-subcarriers-rb-in-4g-lte-and-5g',
'2021/10/11/speed-differences-high-low-frequencies',
'2021/12/22/lte-mimo',
'2022/01/24/o2-beacon-3-orion',
'2022/04/19/ee-nr-ca',
]
// const articles = [
// '2021/07/18/welcome',
// '2021/07/20/introduction-to-4g-and-lte',
// '2021/07/24/lte-bands-and-duplex-modes',
// '2021/08/04/mast-sectorisation-radiation-and-deployment-patterns',
// '2021/08/21/ofdm-subcarriers-rb-in-4g-lte-and-5g',
// '2021/10/11/speed-differences-high-low-frequencies',
// '2021/12/22/lte-mimo',
// '2022/01/24/o2-beacon-3-orion',
// '2022/04/19/ee-nr-ca',
// ]

return articles.map(a => ({
fromPath: `/blog/${a}`,
toPath: `https://mastdatabase.co.uk/blog/${a}`,
isPermanent: true,
statusCode: 308,
}))
// const staticRedirects = [
// {
// fromPath: '/blog',
// toPath: 'https://mastdatabase.co.uk/blog',
// isPermanent: true,
// statusCode: 308,
// },
// {
// fromPath: '/blog/:page',
// toPath: 'https://mastdatabase.co.uk/blog/:page',
// isPermanent: true,
// statusCode: 308,
// },
// ]

return [
{
fromPath: `/blog/*`,
toPath: `https://mastdatabase.co.uk/blog/:splat`,
isPermanent: true,
statusCode: 308,
},
]
}

0 comments on commit 8d4a8a2

Please sign in to comment.