forked from Justin322322/BetterGov-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
53 lines (49 loc) · 1.36 KB
/
source.config.ts
File metadata and controls
53 lines (49 loc) · 1.36 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
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from 'fumadocs-mdx/config';
import { remarkRemoveFirstH1 } from './src/lib/remark/remove-first-h1';
import { z } from 'zod';
// Enhanced frontmatter schema for BetterGov documentation
const customFrontmatterSchema = frontmatterSchema.extend({
category: z.string().optional(),
order: z.number().optional(),
tags: z.array(z.string()).optional(),
lastUpdated: z.string().optional(),
author: z.string().optional(),
difficulty: z.enum(['beginner', 'intermediate', 'advanced']).optional(),
prerequisites: z.array(z.string()).optional(),
relatedPages: z.array(z.string()).optional(),
icon: z.string().optional()
});
// Enhanced meta schema for navigation
const customMetaSchema = metaSchema.extend({
icon: z.string().optional(),
collapsed: z.boolean().optional()
});
// Define documentation collections
export const docs = defineDocs({
docs: {
schema: customFrontmatterSchema,
},
meta: {
schema: customMetaSchema,
},
});
export default defineConfig({
// MDX processing options
mdxOptions: {
remarkPlugins: [
// Add remark plugins for enhanced markdown processing
remarkRemoveFirstH1,
],
rehypePlugins: [
// Add rehype plugins for HTML processing
],
jsx: true,
format: 'mdx',
development: process.env.NODE_ENV === 'development'
}
});