Repository navigation
Expand file tree
/
Copy pathnext.config.ts
More file actions
168 lines (166 loc) · 6.11 KB
/
Copy pathnext.config.ts
File metadata and controls
168 lines (166 loc) · 6.11 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import type { NextConfig } from 'next'
import previewConfig from './src/data/interventions-preview.json'
const nextConfig: NextConfig = {
trailingSlash: true,
skipTrailingSlashRedirect: true,
images: {
unoptimized: true,
},
async headers() {
// Defense in depth; Atlas redirects set noindex in middleware because
// Next's config redirects discard these headers in the production server.
// The old interventions preview prefix stays noindex because every path
// under it now redirects to the public methodology page.
return [{
source: `${previewConfig.basePath}/:path*`,
headers: [{ key: 'X-Robots-Tag', value: 'noindex, nofollow, noarchive' }],
}, {
source: '/neuro-atlas/:path*',
headers: [{ key: 'X-Robots-Tag', value: 'noindex, nofollow' }],
}]
},
async redirects() {
const methodology = '/methodology/'
return [
// The methodology page is public. Old cryptic and catalogue URLs redirect
// there so shared links do not 404. The retired catalogue prefix stays
// noindex above.
{
source: `${previewConfig.basePath}/methodology`,
destination: methodology,
permanent: true,
},
{
source: `${previewConfig.basePath}/methodology/`,
destination: methodology,
permanent: true,
},
{
source: previewConfig.basePath,
destination: methodology,
permanent: false,
},
{
source: `${previewConfig.basePath}/`,
destination: methodology,
permanent: false,
},
{
source: `${previewConfig.basePath}/data`,
destination: methodology,
permanent: false,
},
{
source: `${previewConfig.basePath}/data/`,
destination: methodology,
permanent: false,
},
// Named catalogue slugs only. A wildcard would also match methodology
// and redirect the kept page onto itself.
...[
'juan-benet-neuropodcast',
'bci-roadmap',
'pl-neuro-salon',
'bci-founders-retreat',
'connectomics-workshop',
'ierr-2025',
'dacc-2025',
'sovereign-ai',
'evaluation-commons',
'broad-listening',
'ai4pg',
'ai4cop',
'evidence-research',
'compute-alliance',
'eg-fellowship',
'connectomics-benchmark',
'macaque-projectome',
'discovery-challenge',
'mouse-connectome',
'neuroai-commons',
'virtual-neuro',
'neuroai-fellows',
].flatMap((slug) => ([
{ source: `${previewConfig.basePath}/${slug}`, destination: methodology, permanent: false },
{ source: `${previewConfig.basePath}/${slug}/`, destination: methodology, permanent: false },
])),
// Preserve shared preview links when the approved Neuro article goes live.
{
source: '/blog/preview-neurotech-4972678300d0a37a2a1e0b9d1b40e852/',
destination: '/blog/neurotech-frontier-human-flourishing/',
permanent: true,
},
{
source: '/blog/preview-neurotech-ea88a298/',
destination: '/blog/neurotech-frontier-human-flourishing/',
permanent: true,
},
{
source: '/areas/upgrade-economies-governance/:path*',
destination: '/areas/economies-governance/:path*',
permanent: true,
},
{
source: '/areas/upgrade-economies-governance/',
destination: '/areas/economies-governance/',
permanent: true,
},
// Bare opportunity-space list paths -> the area page's on-page anchor.
// These must come before the wildcard redirects below so the empty
// path segment resolves to the anchor rather than the area root.
{
source: '/areas/economies-governance/opportunity-spaces/',
destination: '/areas/economies-governance/#opportunity-spaces',
permanent: true,
},
{
source: '/areas/ai-robotics/opportunity-spaces/',
destination: '/areas/ai-robotics/#opportunity-spaces',
permanent: true,
},
{
source: '/areas/digital-human-rights/opportunity-spaces/',
destination: '/areas/digital-human-rights/#opportunity-spaces',
permanent: true,
},
{
source: '/areas/neurotech/opportunity-spaces/',
destination: '/areas/neurotech/#opportunity-spaces',
permanent: true,
},
// The Sovereign AI sheets have no index of their own: the program's shelf
// on the FA2 page is it, and /sovereign-ai/ is its short link. The sheets
// lived under /briefs/ until 22 October 2026 and under /programs/ for a
// day after, and PDFs went out with /briefs/ links, so every old address
// lands on its sheet. Trailing slashes are not added for us, so both
// spellings are listed.
...[
'/sovereign-ai',
'/sovereign-ai/',
...['sovereign-ai', 'programs', 'briefs'].flatMap((dir) => [
`/areas/economies-governance/${dir}`,
`/areas/economies-governance/${dir}/`,
]),
].map((source) => ({ source, destination: '/areas/economies-governance/#sovereign-ai', permanent: false })),
...['programs', 'briefs'].flatMap((dir) => [
{ source: `/areas/economies-governance/${dir}/:slug`, destination: '/areas/economies-governance/sovereign-ai/:slug/', permanent: true },
{ source: `/areas/economies-governance/${dir}/:slug/`, destination: '/areas/economies-governance/sovereign-ai/:slug/', permanent: true },
{ source: `/${dir}/:file`, destination: '/sovereign-ai/:file', permanent: true },
{ source: `/images/fa2/${dir}/:file`, destination: '/images/fa2/sovereign-ai/:file', permanent: true },
]),
// Old individual opportunity-space URLs -> new shortened paths.
// Covers both the detail page and its /edit subpath for every area.
{
source: '/areas/:area/opportunity-spaces/:slug*',
destination: '/areas/:area/:slug*',
permanent: true,
},
{
source: '/research/:path*',
destination: '/insights/:path*',
permanent: true,
},
]
},
}
export default nextConfig