-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.mjs
44 lines (43 loc) · 1.27 KB
/
next.config.mjs
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
/** @type {import('next').NextConfig} */
import { withContentlayer } from "next-contentlayer2";
const nextConfig = {
rewrites: async () => {
return {
fallback: [
{
source: "/:path*.:ext([a-zA-Z0-9_+]{1,4})", // Match extensions that are 1-4 AlphaNumeric characters long
destination: "/gh-pages/:path*.:ext", // Rewrite to gh-pages/[path_here].ext
},
{
source: "/tags/:path",
destination: "/gh-pages/tags/:path/index.html",
},
{
source: "/speakers/:path",
destination: "/gh-pages/speakers/:path/index.html",
},
{
source: "/es",
destination: "/gh-pages/es/index.html",
},
{
source: "/zh",
destination: "/gh-pages/zh/index.html",
},
{
source: "/pt",
destination: "/gh-pages/pt/index.html",
},
{
source: "/:path((?!.*\\.[a-zA-Z0-9]{1,4}$).*)", // Matches paths without a valid file extension
destination: "/transcript/:path*", // Rewrite to /transcripts/[path...]
},
{
source: "/:path*",
destination: "/gh-pages/:path*/index.html",
},
],
};
},
};
export default withContentlayer(nextConfig);