-
-
Notifications
You must be signed in to change notification settings - Fork 714
Expand file tree
/
Copy pathsource.config.ts
More file actions
82 lines (77 loc) · 2.16 KB
/
source.config.ts
File metadata and controls
82 lines (77 loc) · 2.16 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
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from "fumadocs-mdx/config";
import { transformerTwoslash } from "fumadocs-twoslash";
import { createFileSystemTypesCache } from "fumadocs-twoslash/cache-fs";
import { z } from "zod/v4";
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.dev/docs/mdx/collections
export const docs = defineDocs({
dir: "content/docs",
docs: {
schema: frontmatterSchema.extend({
// description: z.string(), // make required (unfortunately, breaks build)
imageTitle: z.string().optional(), // add imageTitle to customize text on og image
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export const pages = defineDocs({
dir: "content/pages",
docs: {
schema: frontmatterSchema.extend({
// description: z.string(), // make required (unfortunately, breaks build)
imageTitle: z.string().optional(), // add imageTitle to customize text on og image
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export const examples = defineDocs({
dir: "content/examples",
docs: {
schema: frontmatterSchema.extend({
author: z.string().optional(),
isPro: z.boolean().optional(),
imageTitle: z.string().optional(), // add imageTitle to customize text on og image
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
rehypeCodeOptions: {
themes: {
light: "github-light",
dark: "github-dark",
},
transformers: [
...(rehypeCodeDefaultOptions.transformers ?? []),
transformerTwoslash({
typesCache: createFileSystemTypesCache(),
}),
],
// important: Shiki doesn't support lazy loading languages for codeblocks in Twoslash popups
// make sure to define them first (e.g. the common ones)
langs: ["js", "jsx", "ts", "tsx", "css"],
},
},
});