-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsource.config.ts
More file actions
62 lines (60 loc) · 1.93 KB
/
Copy pathsource.config.ts
File metadata and controls
62 lines (60 loc) · 1.93 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
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from "fumadocs-mdx/config";
import lastModified from "fumadocs-mdx/plugins/last-modified";
import { z } from "zod";
// 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({
product: z.string().optional(),
url: z
.string()
.regex(/^\/.*/, { message: "url must start with a slash" })
.optional(),
type: z
.enum([
"conceptual", // Explains what something is and why it exists. Architecture, mental models, design decisions.
"guide", // Walks through how to accomplish a goal. Tutorials, getting started, workflows.
"reference", // Lookup-oriented, exhaustive details. API docs, config options, function signatures.
"troubleshooting", // Diagnoses problems and solutions. FAQs, errors, known issues, debugging guides.
"integration", // Connects multiple systems. 3rd-party setup, plugins, webhooks, migrations.
"overview", // High-level introductions. Landing pages, changelogs, release notes.
])
.optional(),
prerequisites: z
.array(
z.string().regex(/^\/.*/, {
message: "prerequisites must start with a slash",
})
)
.optional(),
related: z
.array(
z
.string()
.regex(/^\/.*/, { message: "related must start with a slash" })
)
.optional(),
summary: z.string().optional(),
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkMdxMermaid],
},
plugins: [lastModified()],
});