-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
103 lines (101 loc) · 2.8 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
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
const listContent = require('./app/content/utils/listContent');
module.exports = {
pageExtensions: ['js', 'jsx', 'ts', 'tsx'],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'http.cat',
port: '',
pathname: '/*'
}
]
},
async redirects() {
const contentRedirections = (await listContent({ parseFrontmatter: true }))
.filter(
({ redirect_from }) => redirect_from != null && redirect_from.length > 0
)
.map(({ slug, redirect_from }) =>
redirect_from.map((source) => ({
source,
destination: `/content/${slug}`,
permanent: true
}))
)
.flat();
return [
// /articles to /content
{
source: '/articles',
destination: '/content',
permanent: true
},
{
source: '/articles/:slug',
destination: '/content/:slug',
permanent: true
},
// Default resume is english
{
source: '/resume',
destination: '/resume/en',
permanent: true
},
// Removing the certifications page
{
source: '/content/certifications',
destination: '/resume/en#education',
permanent: true
},
...contentRedirections,
// 404 caught by the google search console,
{
source:
'/f0ad71a94a5d8babd8aaf747699e2804/GameAIPro2_Chapter20_Hierarchical_Architecture_for_Group_Navigation_Behaviors.pdf',
destination:
'/content/2015-06-10-hierarchical-architecture-for-group-navigation-behaviors/GameAIPro2_Chapter20_Hierarchical_Architecture_for_Group_Navigation_Behaviors.pdf',
permanent: true
},
{
source: '/content/resume.en/',
destination: '/resume/en',
permanent: true
},
{
source: '/content/resume.en',
destination: '/resume/en',
permanent: true
},
{
source: '/content/resume.fr/',
destination: '/resume/fr',
permanent: true
},
{
source: '/content/resume.fr',
destination: '/resume/fr',
permanent: true
},
{
source:
'/static/2020-the-three-stages-of-xai-4e1079fa1c7003312fe214222d9ed0ce.pdf',
destination:
'/content/2020-04-22-the-three-stages-of-explainable-ai/2020-the-three-stages-of-xai.pdf',
permanent: true
},
{
source:
'/static/gdcaisummit2014-simple-formation-assignment-29fa0b624feac0c5992313f75baad4d7.pdf',
destination:
'/content/2014-03-17-gdcaisummit2014-environmentally-conscious-ai/gdcaisummit2014-simple-formation-assignment.pdf',
permanent: true
},
{
source: '/index.html',
destination: '/',
permanent: true
}
];
}
};