Skip to content

Commit 5cb42a6

Browse files
committed
Update source.config.ts
1 parent 8c6957e commit 5cb42a6

1 file changed

Lines changed: 61 additions & 3 deletions

File tree

apps/docs/source.config.ts

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,46 @@ import {
55
frontmatterSchema,
66
metaSchema,
77
} from "fumadocs-mdx/config";
8-
import lastModified from "fumadocs-mdx/plugins/last-modified";
98
import { z } from "zod";
109

1110
// You can customise Zod schemas for frontmatter and `meta.json` here
1211
// see https://fumadocs.dev/docs/mdx/collections
1312
export const docs = defineDocs({
1413
dir: "content/docs",
1514
docs: {
15+
postprocess: {
16+
includeProcessedMarkdown: true,
17+
},
18+
schema: frontmatterSchema.extend({
19+
product: z.string().optional(),
20+
url: z
21+
.string()
22+
.regex(/^\/.*/, { message: "url must start with a slash" })
23+
.optional(),
24+
type: z.enum([
25+
"conceptual", // Explains what something is and why it exists. Architecture, mental models, design decisions.
26+
"guide", // Walks through how to accomplish a goal. Tutorials, getting started, workflows.
27+
"reference", // Lookup-oriented, exhaustive details. API docs, config options, function signatures.
28+
"troubleshooting", // Diagnoses problems and solutions. FAQs, errors, known issues, debugging guides.
29+
"integration", // Connects multiple systems. 3rd-party setup, plugins, webhooks, migrations.
30+
"overview" // High-level introductions. Landing pages, changelogs, release notes.
31+
]).optional(),
32+
prerequisites: z.array(z.string().regex(/^\/.*/, { message: "prerequisites must start with a slash" })).optional(),
33+
related: z.array(z.string().regex(/^\/.*/, { message: "related must start with a slash" })).optional(),
34+
summary: z.string().optional(),
35+
}),
36+
},
37+
meta: {
38+
schema: metaSchema,
39+
},
40+
});
41+
42+
export const components = defineDocs({
43+
dir: "content/components",
44+
docs: {
45+
postprocess: {
46+
includeProcessedMarkdown: true,
47+
},
1648
schema: frontmatterSchema.extend({
1749
product: z.string().optional(),
1850
url: z
@@ -31,18 +63,44 @@ export const docs = defineDocs({
3163
related: z.array(z.string().regex(/^\/.*/, { message: "related must start with a slash" })).optional(),
3264
summary: z.string().optional(),
3365
}),
66+
},
67+
meta: {
68+
schema: metaSchema,
69+
},
70+
});
71+
72+
export const examples = defineDocs({
73+
dir: "content/examples",
74+
docs: {
3475
postprocess: {
3576
includeProcessedMarkdown: true,
3677
},
78+
schema: frontmatterSchema.extend({
79+
product: z.string().optional(),
80+
url: z
81+
.string()
82+
.regex(/^\/.*/, { message: "url must start with a slash" })
83+
.optional(),
84+
type: z.enum([
85+
"conceptual", // Explains what something is and why it exists. Architecture, mental models, design decisions.
86+
"guide", // Walks through how to accomplish a goal. Tutorials, getting started, workflows.
87+
"reference", // Lookup-oriented, exhaustive details. API docs, config options, function signatures.
88+
"troubleshooting", // Diagnoses problems and solutions. FAQs, errors, known issues, debugging guides.
89+
"integration", // Connects multiple systems. 3rd-party setup, plugins, webhooks, migrations.
90+
"overview" // High-level introductions. Landing pages, changelogs, release notes.
91+
]).optional(),
92+
prerequisites: z.array(z.string().regex(/^\/.*/, { message: "prerequisites must start with a slash" })).optional(),
93+
related: z.array(z.string().regex(/^\/.*/, { message: "related must start with a slash" })).optional(),
94+
summary: z.string().optional(),
95+
}),
3796
},
3897
meta: {
39-
schema: metaSchema
98+
schema: metaSchema,
4099
},
41100
});
42101

43102
export default defineConfig({
44103
mdxOptions: {
45104
remarkPlugins: [remarkMdxMermaid],
46105
},
47-
plugins: [lastModified()],
48106
});

0 commit comments

Comments
 (0)