-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathnext.config.ts
More file actions
100 lines (95 loc) · 2.37 KB
/
Copy pathnext.config.ts
File metadata and controls
100 lines (95 loc) · 2.37 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import path from "node:path";
import createMDX from "@next/mdx";
import type { NextConfig } from "next";
// MDX plugins are passed as resolvable module specifiers (not imported values)
// so Turbopack can serialize the loader rule. @next/mdx resolves these via
// Node's require.resolve relative to each MDX file's directory, so local
// plugins need absolute paths.
const projectRoot = import.meta.dirname;
const localPlugin = (relativePath: string) => path.join(projectRoot, relativePath);
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
"remark-frontmatter",
"remark-gfm",
localPlugin("lib/remark-annotate-mdx.mjs"),
[
localPlugin("lib/remark-llms.mjs"),
{
mdxAsPlaceholder: [
"PingPreview",
"Rights",
"OptOut",
"Receipt",
"Kbd",
"BlogCTA",
"BlogInlineCTA",
],
},
],
],
rehypePlugins: [
"rehype-slug",
[
"rehype-pretty-code",
{
theme: { light: "github-light", dark: "github-dark" },
defaultColor: false,
keepBackground: false,
defaultLang: {
block: "text",
},
},
],
],
},
});
const nextConfig: NextConfig = {
pageExtensions: ["ts", "tsx", "md", "mdx"],
async redirects() {
return [
{
source: "/desktop",
destination: "/",
permanent: false,
},
{
source: "/about",
destination: "/",
permanent: false,
},
{
source: "/applications",
destination: "/",
permanent: false,
},
{
source: "/atom",
destination: "https://zed.dev/docs/repl",
permanent: false,
},
{
source: "/kernels",
destination: "https://github.com/runtimed/kernel-testbed",
permanent: false,
},
{
source: "/kernels/:slug",
destination: "https://github.com/runtimed/kernel-testbed",
permanent: false,
},
{
source: "/libraries",
destination: "https://github.com/runtimed/runtimed",
permanent: false,
},
{
source: "/sdk",
destination: "https://nteract-elements.vercel.app/docs",
permanent: false,
},
];
},
};
export default withMDX(nextConfig);