-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
61 lines (57 loc) · 1.66 KB
/
Copy pathnext.config.ts
File metadata and controls
61 lines (57 loc) · 1.66 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
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
const nextConfig: NextConfig = {
reactStrictMode: true,
async rewrites() {
const blogRewrites = [
{
source: "/blog",
destination: "/blog/index.html",
},
{
source: "/blog/posts",
destination: "/blog/posts/index.html",
},
{
source: "/blog/posts/:slug",
destination: "/blog/posts/:slug/index.html",
},
{
source: "/blog/archives",
destination: "/blog/archives/index.html",
},
{
source: "/blog/search",
destination: "/blog/search/index.html",
},
{
source: "/blog/tags",
destination: "/blog/tags/index.html",
},
{
source: "/blog/categories",
destination: "/blog/categories/index.html",
},
];
const localizedBlogRewrites = blogRewrites.map((rewrite) => ({
source: `/zh${rewrite.source}`,
destination: rewrite.destination,
}));
return [
...blogRewrites,
...localizedBlogRewrites,
{
source: "/open-source/nextjs-portfolio-blog-research/docs",
destination:
"https://nextjs-portfolio-blog-research-docs.vercel.app/open-source/nextjs-portfolio-blog-research/docs",
},
{
source: "/open-source/nextjs-portfolio-blog-research/docs/:path*",
destination:
"https://nextjs-portfolio-blog-research-docs.vercel.app/open-source/nextjs-portfolio-blog-research/docs/:path*",
},
];
},
};
export default withNextIntl(nextConfig);