-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsource.config.ts
More file actions
50 lines (46 loc) · 1.3 KB
/
source.config.ts
File metadata and controls
50 lines (46 loc) · 1.3 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
import {
defineConfig,
defineDocs,
defineCollections,
frontmatterSchema,
metaSchema,
} from "fumadocs-mdx/config";
import { z } from "zod";
// Define the dependency schema to match the VersionBadgeProps structure
const dependencySchema = z.object({
name: z.string(),
minVersion: z.string(),
link: z.string().url().optional(),
});
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
export const docs = defineDocs({
docs: {
schema: frontmatterSchema.extend({
author: z.string().optional(),
authorUrl: z.string().url().optional(),
date: z.string().date().or(z.date()),
dependencies: z.array(dependencySchema).optional(),
}),
},
meta: {
schema: metaSchema,
},
});
// Define blog collection for blog posts in the content/blog directory
export const blogPosts = defineCollections({
type: "doc",
dir: "content/blog",
schema: frontmatterSchema.extend({
author: z.string().optional().default("Fiber Team"),
authorUrl: z.string().url().optional(),
date: z.string().date().or(z.date()).optional(),
readTime: z.string().optional(),
tags: z.array(z.string()).optional().default([]),
}),
});
export default defineConfig({
mdxOptions: {
// MDX options
},
});