generated from shuding/nextra-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
52 lines (49 loc) · 1.47 KB
/
next.config.js
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
const shiki = require("shiki");
const BUNDLED_LANGUAGES = shiki.BUNDLED_LANGUAGES;
const getHighlighter = shiki.getHighlighter;
const nextConfig = {
transpilePackages: ["react-tweet"],
mdxOptions: {
rehypePrettyCodeOptions: {
getHighlighter: (options) =>
getHighlighter({
...options,
langs: [
...BUNDLED_LANGUAGES,
// custom grammar options, see the Shiki documentation for how to provide these options
{
id: "vue",
scopeName: "source.vue",
aliases: ["vue"], // Along with id, aliases will be included in the allowed names you can use when writing markdown.
path: "../../public/syntax/vue.tmLanguage.json",
},
{
id: "svelte",
scopeName: "source.svelte",
aliases: ["svelte"], // Along with id, aliases will be included in the allowed names you can use when writing markdown.
path: "../../public/syntax/svelte.tmLanguage.json",
},
],
}),
},
},
async redirects() {
return [
{
source: "/how/github",
destination: "/how/cd",
permanent: true,
},
{
source: "/how/vercel",
destination: "/how/cd",
permanent: true,
},
];
},
};
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});
module.exports = withNextra(nextConfig);