-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
57 lines (55 loc) · 1.96 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import {
PER_COHORT_LINKS,
CURRENT_COHORT,
EXTERNAL_LINKS_PATH,
STATIC_LINKS,
} from './src/app/cohort/softwareForClimateCourseLinks.js';
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'v5.airtableusercontent.com',
port: '',
},
],
},
async redirects() {
return [
// Redirect from home to the only page we've built so far
{
source: '/',
destination: '/frameworks/drawdown-solutions-sectors',
permanent: false,
},
// Add redirects for "Software for Climate" ongoing links
// (so that the url path is more huamn-readably & friendly)
...STATIC_LINKS.map(({ slug, url }) => {
return {
source: `${EXTERNAL_LINKS_PATH}/${slug}`,
destination: url,
permanent: false,
};
}),
// Add redirects for links for the current cohort of Software For Climate
// (so that we only have to update those links in one place, for each new cohort)
...PER_COHORT_LINKS[CURRENT_COHORT].map(({ slug, url }) => {
return {
source: `${EXTERNAL_LINKS_PATH}/${slug}`,
destination: url,
permanent: false,
};
}),
// We host redirects to external links at EXTERNAL_LINKS_PATH
// However, we list all the current cohort's links at /cohort/current
// Therefore, if anyone tries to just go to EXTERNAL_LINKS_PATH, redirect to /cohort/current
{
source: EXTERNAL_LINKS_PATH,
destination: '/cohort/current',
permanent: false,
},
];
},
};
export default nextConfig;