-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
62 lines (58 loc) · 1.43 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import nextMdx from "@next/mdx";
import rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import remarkMath from "remark-math";
import remarkGfm from "remark-gfm";
const withMDX = nextMdx({
extension: /\.mdx?$/,
options: {
providerImportSource: "@mdx-js/react",
remarkPlugins: [remarkMath, remarkGfm],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
},
],
rehypeKatex,
],
},
});
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
async redirects() {
return [
{
source: "/slack",
destination:
"https://join.slack.com/t/prairielearn/shared_invite/zt-13kx0hg6v-uuC3kyt_3iBxjSpyhCbYVw",
permanent: true,
},
{
source: "/oer",
destination: "/catalog/oer",
permanent: true,
},
{
source: "/gallery/questions/:slug*",
destination: "/catalog/questions",
permanent: true,
},
{
source: "/gallery/courses",
destination: "/catalog/oer",
permanent: true,
},
{
source: "/gallery/assessments/:slug*",
destination: "/catalog/assessments/:slug*",
permanent: true,
},
];
},
};
export default withMDX(nextConfig);