-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.mjs
More file actions
41 lines (36 loc) · 1.1 KB
/
next.config.mjs
File metadata and controls
41 lines (36 loc) · 1.1 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
import rehypeSlug from 'rehype-slug';
import createMDX from '@next/mdx'
import rehypeToc from "rehype-toc";
import { rehypeSection } from './plugins/rehypeSections.mjs';
import { rehypeImageWrapper } from './plugins/rehypeImageWrapper.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions`` to include MDX files
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
// Optionally, add any other Next.js config below
output: "export",
images: {
unoptimized: true,
}
}
const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [
],
rehypePlugins: [
rehypeSlug,
[rehypeToc, {
headings: ["h1", "h2", "h3"], // Only include <h1> and <h2> headings in the TOC
cssClasses: {
toc: "page-outline", // Change the CSS class for the TOC
link: "page-link", // Change the CSS class for links in the TOC
},
}],
rehypeSection,
rehypeImageWrapper,
],
},
})
// Merge MDX config with Next.js config
export default withMDX(nextConfig)