-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnext.config.mjs
62 lines (54 loc) · 1.66 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 rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode from 'rehype-pretty-code';
/** @type {import('rehype-autolink-headings').Options} */
const rehypeAutolinkHeadingsOptions = {
behavior: 'wrap'
};
/** @type {import('rehype-pretty-code').Options} */
const rehypePrettyCodeOptions = {
// Use one of Shiki's packaged themes
theme: {
light: 'light-plus',
dark: 'dark-plus'
},
// Keep the background or use a custom background color?
keepBackground: false,
onVisitLine(element) {
// Add a custom class to each line
element.properties.className = ['line'];
},
onVisitHighlightedLine(element) {
// Add a custom class to each highlighted line
element.properties.className.push('highlighted');
},
onVisitHighlightedChars(element) {
// Add a custom class to each highlighted character
element.properties.className = ['word'];
}
};
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
// as the package is ESM only
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [],
rehypePlugins: [
rehypeSlug,
[rehypeAutolinkHeadings, rehypeAutolinkHeadingsOptions],
[rehypePrettyCode, rehypePrettyCodeOptions]
],
// If you use `MDXProvider`, uncomment the following line.
providerImportSource: '@mdx-js/react'
}
});
export default withMDX({
reactStrictMode: true,
swcMinify: true,
images: {
domains: ['avatars.githubusercontent.com', 'i.scdn.co']
},
pageExtensions: ['ts', 'tsx', 'md', 'mdx']
});