generated from shuding/nextra-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
54 lines (53 loc) · 1.49 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
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});
module.exports = withNextra({
i18n: {
locales: ["en", "zh"],
defaultLocale: "en",
},
redirects: () => [
{
source: "/api/:slug*",
destination: "/aypeeeye/:slug*", // Matched parameters can be used in the destination
permanent: true,
},
// redirect /install to /self-host/install
{
source: "/install/:slug*",
destination: "/self-host-install/:slug*",
permanent: true,
},
// redirect /troubleshooting to /self-host-install/troubleshooting
{
source: "/troubleshooting/:slug*",
destination: "/self-host-install/troubleshooting",
permanent: true,
},
// redirect /upgrade to /self-host-install/upgrade
{
source: "/upgrade/:slug*",
destination: "/self-host-install/upgrade",
permanent: true,
},
// redirect all .en
{
source: "/:slug*.en",
destination: "/:slug*",
permanent: true,
},
//redirect all .zh to /zh/
{
source: "/:slug*.zh",
destination: "/:slug*",
permanent: true,
},
// redirect all /en/ urls
{
source: "/en/:slug*",
destination: "/:slug*",
permanent: true,
},
],
});