-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.mjs
More file actions
58 lines (54 loc) · 1.66 KB
/
next.config.mjs
File metadata and controls
58 lines (54 loc) · 1.66 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
import createMDX from '@next/mdx'
import rehypeSlug from 'rehype-slug'
import remarkGfm from 'remark-gfm'
import { visit } from 'unist-util-visit'
function remarkBugRef() {
return function (tree) {
visit(tree, 'text', function (node, index, parent) {
if (node.value.endsWith(':bugref:')) {
node.value = node.value.slice(0, node.value.length - 8)
const next = parent.children[index + 1]
const issue = next.value
parent.children[index + 1] = {
type: 'link',
url: `https://github.com/minizinc/libminizinc/issues/${issue}`,
children: [{ type: 'text', value: `issue ${issue}` }],
}
} else if (node.value.endsWith(':idebugref:')) {
node.value = node.value.slice(0, node.value.length - 118)
const next = parent.children[index + 1]
const issue = next.value
parent.children[index + 1] = {
type: 'link',
url: `https://github.com/minizinc/MiniZincIDE/issues/${issue}`,
children: [{ type: 'text', value: `issue ${issue}` }],
}
}
})
}
}
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
scrollRestoration: true,
},
output: 'export',
images: {
unoptimized: true,
},
trailingSlash: true,
publicRuntimeConfig: {
copyrightYear: new Date().getFullYear(),
basePath: process.env.BASE_PATH || '',
},
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
basePath: process.env.BASE_PATH || '',
}
const withMDX = createMDX({
options: {
remarkPlugins: [remarkGfm, remarkBugRef],
rehypePlugins: [rehypeSlug],
},
})
export default withMDX(nextConfig)