-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
45 lines (41 loc) · 1.32 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
import createMDX from '@next/mdx'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import remarkSlug from 'remark-slug'
import remarkFrontmatter from 'remark-frontmatter'
import rehypeKatex from 'rehype-katex'
import rehypeMdxImportMedia from 'rehype-mdx-import-media'
import rehypeToc from '@jsdevtools/rehype-toc'
import { rehypeExtendedHighlight } from '@gears-bot/rehype/extended-highlight'
import { all } from 'lowlight'
import { solidity } from 'highlightjs-solidity'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeMermaid from 'rehype-mermaid'
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
}
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
remarkGfm,
remarkMath,
remarkSlug,
[remarkFrontmatter, ['yaml', 'toml']],
],
rehypePlugins: [
rehypeKatex,
[rehypeMdxImportMedia, { elementAttributeNameCase: 'html' }],
rehypeToc,
[
rehypeExtendedHighlight,
{ tabsName: 'Tabs', tabName: 'Tab', languages: { ...all, solidity } },
],
[rehypeAutolinkHeadings, { behavior: 'append' }],
[rehypeMermaid, { strategy: 'pre-mermaid' }],
],
},
})
export default withMDX(nextConfig)