-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsource.config.ts
More file actions
64 lines (61 loc) · 1.51 KB
/
source.config.ts
File metadata and controls
64 lines (61 loc) · 1.51 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
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from 'fumadocs-mdx/config';
import { remarkMermaid } from '@theguild/remark-mermaid';
import rehypeComponents from 'rehype-components';
import { z } from 'zod';
// Extend the schema to support custom homepage frontmatter
const extendedFrontmatterSchema = frontmatterSchema.extend({
layout: z.string().optional(),
titleTemplate: z.string().optional(),
hero: z.object({
name: z.string().optional(),
text: z.string().optional(),
tagline: z.string().optional(),
image: z.object({
src: z.string(),
alt: z.string(),
}).optional(),
actions: z.array(z.object({
theme: z.string(),
text: z.string(),
link: z.string(),
})).optional(),
}).optional(),
features: z.array(z.object({
title: z.string(),
details: z.string(),
link: z.string(),
icon: z.string().optional(),
})).optional(),
});
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.dev/docs/mdx/collections#define-docs
export const docs = defineDocs({
dir: 'content',
docs: {
schema: extendedFrontmatterSchema,
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkMermaid],
rehypePlugins: [
[
rehypeComponents,
{
components: {
DocImage: '@/components/doc-image',
ConsensusImage: '@/components/consensus-image',
},
},
],
],
},
});