-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
84 lines (79 loc) · 2.24 KB
/
Copy pathsource.config.ts
File metadata and controls
84 lines (79 loc) · 2.24 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from "fumadocs-mdx/config";
import lastModified from "fumadocs-mdx/plugins/last-modified";
import remarkGfm from "remark-gfm";
import rehypeSlug from "rehype-slug";
import { z } from "zod";
export const docs = defineDocs({
dir: "content/docs",
docs: {
schema: frontmatterSchema.extend({
version: z.string().optional(),
date: z.string().optional(),
tags: z.array(z.string()).optional(),
}),
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export const blog = defineDocs({
dir: "content/blog",
docs: {
schema: frontmatterSchema.extend({
date: z.string().optional(), // ISO YYYY-MM-DD; used for footer "latest posts" sort
// Routes the auto-generated X Article draft to the post author's account
// (see scripts/blog-to-x.mjs). Optional so a missing value never breaks the
// site build — the automation just skips posts without a known author.
author: z.enum(["kelsen", "archer"]).optional(),
}),
},
meta: {
schema: metaSchema,
},
});
export const changelog = defineDocs({
dir: "content/changelog",
docs: {
schema: frontmatterSchema.extend({
date: z.string(), // ISO YYYY-MM-DD (required)
version: z.string().optional(),
tags: z.array(z.string()).optional(),
breaking: z.boolean().optional(),
}),
},
meta: {
schema: metaSchema,
},
});
export const legal = defineDocs({
dir: "content/legal",
docs: {
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
// One-Dark token colours site-wide (docs, blog, changelog). fumadocs'
// rehype-code always runs in dual-theme mode (codeToTokensWithThemes), so a
// `themes` map is required — both slots are one-dark-pro (dark-only). Token
// colours come through as --shiki-dark CSS vars; the panel background is set
// in globals.css (Shiki doesn't emit a static bg in dual mode).
rehypeCodeOptions: {
themes: { light: "one-dark-pro", dark: "one-dark-pro" },
},
},
plugins: [lastModified()],
});