-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
60 lines (55 loc) · 1.49 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
import remarkGfm from 'remark-gfm'
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import createMDX from '@next/mdx'
import rehypeSlug from 'rehype-slug'
import rehypeFormat from 'rehype-format'
import rehypeStringify from 'rehype-stringify'
import remarkParse from 'remark-parse'
// import remarkPdf from 'remark-pdf'
import remarkRehype from 'remark-rehype'
import rehypeRewrite from 'rehype-rewrite'
import remarkCustomHeaderId from 'remark-custom-header-id';
import { remarkSectionize } from './remark-plugins.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
images: {
remotePatterns: [
{
protocol: "https",
hostname: "ik.imagekit.io",
port: "",
},
{
protocol: "https",
hostname: "s.gravatar.com",
port: "",
},
],
},
}
const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [
remarkParse,
remarkFrontmatter,
remarkMdxFrontmatter,
remarkGfm,
remarkCustomHeaderId,
remarkSectionize,
remarkRehype,
],
rehypePlugins: [
rehypeRewrite,
rehypeSlug,
rehypeFormat,
rehypeStringify,
],
},
})
// Wrap MDX and Next.js config with each other
export default withMDX(nextConfig)