-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
62 lines (57 loc) · 1.78 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 { serialize } from "next-mdx-remote/serialize";
import readingTime from "reading-time";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdx from "remark-mdx";
import remarkGfm from "remark-gfm";
import rehypePrism from "rehype-prism";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import { rehypeAccessibleEmojis } from "rehype-accessible-emojis";
const prettyCodeOptions = {
keepBackground: false,
};
const rehypeAutoLinkOptions = ['wrap' ]
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: '/sitemap.xml',
destination: '/api/sitemap'
}
];
},
// Configure pageExtensions to include md and mdx
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
experimental: {
// fontLoaders: [
// { loader: "@next/font/google", options: { subsets: ["latin"] } },
// ],
},
reactStrictMode: true,
};
export default nextMDX({
extension: /\/data\/(articles|blog|release)\/.+\.mdx?$/,
// extension: /\.mdx?$/,
options: {
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [remarkMdx, [remarkFrontmatter, 'yaml'], remarkGfm],
rehypePlugins: [
rehypeSlug,
[rehypeAutolinkHeadings, { properties: { className: ["anchor"] }, behaviour:'wrap'} ],
[rehypePrettyCode, prettyCodeOptions],
rehypeAccessibleEmojis,
[
rehypePrism,
{
theme: "twilight",
plugins: ["line-numbers", "autolinker", "show-language"],
},
],
],
// If you use `MDXProvider`, uncomment the following line.
// providerImportSource: "@mdx-js/react",
},
})(nextConfig);