-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
71 lines (68 loc) · 1.76 KB
/
next.config.mjs
File metadata and controls
71 lines (68 loc) · 1.76 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
62
63
64
65
66
67
68
69
70
71
import createMDX from '@next/mdx'
import remarkToc from 'remark-toc'
import rehypePrettyCode from 'rehype-pretty-code'
import {
transformerNotationFocus,
transformerNotationDiff,
transformerNotationHighlight,
transformerNotationWordHighlight,
} from '@shikijs/transformers'
import remarkGfm from 'remark-gfm'
import remarkFrontmatter from 'remark-frontmatter'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import remarkRehype from 'remark-rehype'
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
// Disable ESLint during production builds
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
}
/** @type {import('rehype-pretty-code').Options} */
const options = {
theme: {
dark: 'gruvbox-dark-hard',
light: 'gruvbox-light-hard',
},
keepBackground: false,
transformers: [
transformerNotationDiff(),
transformerNotationHighlight(),
transformerNotationWordHighlight(),
transformerNotationFocus(),
],
}
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
[
remarkToc,
{
heading: 'table of contents',
maxDepth: 4,
tight: true,
ordered: false,
skip: 'table of contents',
},
],
remarkGfm,
remarkFrontmatter,
remarkMath,
[
remarkRehype,
// {
// allowDangerousHtml: true,
// footnoteBackContent: '↑',
// },
],
],
rehypePlugins: [[rehypePrettyCode, options], [rehypeKatex]],
},
})
export default withMDX(nextConfig)