-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
42 lines (36 loc) · 1.13 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
import createMDX from '@next/mdx';
import { remarkCodeHike } from 'codehike/mdx';
import rehypeKatex from 'rehype-katex';
import rehypeSlug from 'rehype-slug';
import rehypeUnwrapImages from 'rehype-unwrap-images';
import remarkFrontmatter from 'remark-frontmatter';
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';
import { redirects } from './scripts/redirects.mjs';
import remarkPublicImage from './scripts/remark-public-image.mjs';
import remarkToc from './scripts/remark-toc.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
redirects,
pageExtensions: ['ts', 'tsx', 'mdx'],
};
const codehikeConfig = {
components: { code: 'Code' },
syntaxHighlighting: { theme: 'github-from-css' },
};
const withMDX = createMDX({
options: {
remarkPlugins: [
remarkFrontmatter,
remarkMdxFrontmatter,
remarkGfm,
remarkMath,
remarkToc,
remarkPublicImage,
[remarkCodeHike, codehikeConfig],
],
rehypePlugins: [rehypeSlug, rehypeKatex, rehypeUnwrapImages],
},
});
export default withMDX(nextConfig);