-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
68 lines (64 loc) · 1.46 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
63
64
65
66
67
68
// @ts-check
import nextra from "nextra";
import { getSingletonHighlighter, bundledLanguages } from "shiki";
import { readFileSync } from "fs";
const adelfaGrammar = JSON.parse(
readFileSync("./syntax/adelfa.tmLanguage.json", "utf-8"),
);
const lfGrammar = JSON.parse(
readFileSync("./syntax/lf.tmLanguage.json", "utf-8"),
);
const withNextra = nextra({
theme: "nextra-theme-docs",
latex: true,
themeConfig: "./theme.config.tsx",
defaultShowCopyCode: true,
search: true,
mdxOptions: {
rehypePrettyCodeOptions: {
getHighlighter: (options) =>
getSingletonHighlighter({
...options,
langs: [
...Object.values(bundledLanguages),
// custom grammar options, see the Shiki documentation for how to
// provide these options
{
name: "adelfa",
...adelfaGrammar,
},
{
name: "lf",
...lfGrammar,
},
],
}),
},
},
});
export default withNextra({
async redirects() {
return [
{
source: "/adelfa.html",
destination: "/",
permanent: true,
},
{
source: "/adelfa",
destination: "/",
permanent: true,
},
{
source: "/index.html",
destination: "/",
permanent: true,
},
{
source: "/index",
destination: "/",
permanent: true,
},
];
},
});