Refactor v2 redirects into separate variable for maintainability

This commit is contained in:
Xevion
2022-12-30 23:50:18 -06:00
parent d3dccc8d85
commit 55938f5ea9

View File

@@ -5,6 +5,20 @@
*/
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs"));
const v2_redirects = [
'/2020/12/04/jekyll-github-pages-and-azabani',
'/2021/02/25/project-facelift-new-and-old',
'/2022/03/29/runnerspace-built-in-under-30-hours',
'/2022/07/16/restricted-memory-and-data-framing-tricks',
'/drafts/presenting-to-humans',
'/photography'
].map(url => {
return {
source: url, destination: `https://v2.xevion.dev${url}`, permanent: false
}
})
/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
@@ -17,12 +31,7 @@ const config = {
// Source cannot end with / slash
return [
{source: '/resume', destination: '/resume.pdf', permanent: false},
{source: '/2020/12/04/jekyll-github-pages-and-azabani', destination: 'https://v2.xevion.dev/2020/12/04/jekyll-github-pages-and-azabani/', permanent: false},
{source: '/2021/02/25/project-facelift-new-and-old', destination: 'https://v2.xevion.dev/2021/02/25/project-facelift-new-and-old/', permanent: false},
{source: '/2022/03/29/runnerspace-built-in-under-30-hours', destination: 'https://v2.xevion.dev/2022/03/29/runnerspace-built-in-under-30-hours/', permanent: false},
{source: '/2022/07/16/restricted-memory-and-data-framing-tricks', destination: 'https://v2.xevion.dev/2022/07/16/restricted-memory-and-data-framing-tricks/', permanent: false},
{source: '/photography', destination: 'https://v2.xevion.dev/photography/', permanent: false},
{source: '/drafts/presenting-to-humans', destination: 'https://v2.xevion.dev/drafts/presenting-to-humans/', permanent: false}
...v2_redirects
]
}
};