-
Notifications
You must be signed in to change notification settings - Fork 354
Expand file tree
/
Copy pathsource.config.ts
More file actions
108 lines (104 loc) · 4.52 KB
/
source.config.ts
File metadata and controls
108 lines (104 loc) · 4.52 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
101
102
103
104
105
106
107
108
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 const blog = defineDocs({
dir: "content/blog",
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 const examples = defineDocs({
dir: "content/examples",
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()],
});