-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsource.config.ts
More file actions
33 lines (31 loc) · 877 Bytes
/
source.config.ts
File metadata and controls
33 lines (31 loc) · 877 Bytes
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
import { defineConfig, defineDocs } from 'fumadocs-mdx/config'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import { z } from 'zod'
export const blog = defineDocs({
dir: 'content/blog',
docs: {
schema: z.object({
title: z.string(),
description: z.string().optional(),
date: z.union([z.string(), z.date()]),
category: z.string().optional(),
readTime: z.string().optional(),
tags: z.array(z.string()).default([]),
}),
},
})
export default defineConfig({
mdxOptions: {
remarkImageOptions: false,
rehypeCodeOptions: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
langs: ['js', 'jsx', 'ts', 'tsx', 'glsl', 'diff'],
},
remarkPlugins: plugins => [remarkMath, ...plugins],
rehypePlugins: plugins => [rehypeKatex, ...plugins],
},
})