Repository navigation
Expand file tree
/
Copy pathsource.config.ts
More file actions
48 lines (45 loc) · 1.5 KB
/
Copy pathsource.config.ts
File metadata and controls
48 lines (45 loc) · 1.5 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
import { defineDocs, defineConfig, frontmatterSchema } from 'fumadocs-mdx/config';
import { z } from 'zod';
export const docs = defineDocs({
dir: 'content/docs',
docs: {
schema: frontmatterSchema.extend({
title: z.string().optional().default(''),
description: z.string().optional(),
// Optional agent-retrieval metadata. Capability relationships are derived
// from lib/capabilities.snapshot.json instead of duplicated in frontmatter.
audience: z.array(z.enum(['merchant', 'developer'])).optional(),
status: z.enum(['available', 'beta', 'deprecated']).optional(),
last_verified: z
.string()
.regex(/^\d{4}-\d{2}-\d{2}$/, 'last_verified must be YYYY-MM-DD')
.refine((v) => !Number.isNaN(Date.parse(v)) && new Date(v).toISOString().startsWith(v), {
message: 'last_verified must be a real calendar date',
})
.optional(),
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
});
export const changelog = defineDocs({
dir: 'content/changelog',
docs: {
schema: frontmatterSchema.extend({
title: z.string(),
publishedAt: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'publishedAt must be YYYY-MM-DD'),
tags: z.array(z.string()).default([]),
summary: z.string(),
authors: z.array(z.string()).optional(),
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
});
export default defineConfig({
mdxOptions: {
providerImportSource: '@/components/mdx',
},
});