-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
45 lines (42 loc) · 1.07 KB
/
Copy pathsource.config.ts
File metadata and controls
45 lines (42 loc) · 1.07 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
import { remarkInstall } from "fumadocs-docgen";
import {
type DefaultMDXOptions,
defineConfig,
defineDocs,
frontmatterSchema,
} from "fumadocs-mdx/config";
import { z } from "zod";
export const { docs, meta } = defineDocs({
dir: "content/blog",
docs: {
schema: frontmatterSchema.extend({
description: z
.string()
.describe("A brief description of the post for SEO and previews"),
draft: z.boolean().optional().default(false),
author: z.string().describe("Author of the post, github username"),
date: z
.string()
.or(z.date())
.transform((value, context) => {
try {
return new Date(value);
} catch {
context.addIssue({
code: z.ZodIssueCode.custom,
message: "Invalid date",
});
return z.NEVER;
}
}),
}),
},
});
const mdxOptions: DefaultMDXOptions = {
remarkPlugins: [remarkInstall],
rehypePlugins: (v) => [...v],
};
export default defineConfig({
mdxOptions,
// generateManifest: false,
});