-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
85 lines (80 loc) · 2.74 KB
/
Copy pathsource.config.ts
File metadata and controls
85 lines (80 loc) · 2.74 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
85
import { defineDocs, defineCollections, defineConfig, frontmatterSchema } from 'fumadocs-mdx/config';
import { z } from 'zod';
import { remarkAdmonition } from 'fumadocs-core/mdx-plugins';
import { remarkMermaid } from './src/lib/remark-mermaid';
// `:::note / :::tip / :::warning / :::caution` colon-fence callouts -> <Callout>.
// Without this, Fumadocs 16 leaves the `:::` markers as literal text on every
// page that uses them. Cover every type used across the docs (the default
// typeMap omits `caution`).
const admonitionTypeMap = {
info: 'info',
note: 'info',
tip: 'info',
warn: 'warn',
warning: 'warn',
caution: 'warn',
danger: 'error',
error: 'error',
success: 'success',
};
export const docs = defineDocs({
dir: 'content/docs',
});
export const changelog = defineCollections({
type: 'doc',
dir: 'content/changelog',
schema: frontmatterSchema.extend({
date: z.string(),
category: z.enum([
'Dashboard',
'Tracking',
'CMS',
'CLI',
'Docs',
'OpenAffiliate',
'Bugfix',
]),
benefit: z.string(),
authors: z.array(z.string()).optional(),
sourcePR: z.string().url().optional(),
image: z.string().optional(),
}),
});
export const blog = defineCollections({
type: 'doc',
dir: 'content/blog',
schema: frontmatterSchema.extend({
// description doubles as the one-line dek + machine summary — required for blog
description: z.string(),
date: z.string(),
category: z.string(),
authors: z.array(z.string()),
readTime: z.string().optional(),
image: z.string().optional(),
// AI-citability fields (AI-RANK-redesign.md A2/A7) — all optional, template-driven
// ISO date of last content refresh; drives dateModified in BlogPosting schema
// and the visible "Updated" label. Falls back to `date` when absent.
updated: z.string().optional(),
// FAQ section mirror -> FAQPage JSON-LD
faq: z.array(z.object({ q: z.string(), a: z.string() })).optional(),
// Tool names in ranked order (listicle posts) -> ItemList JSON-LD
tools: z.array(z.string()).optional(),
// How-to posts -> HowTo JSON-LD (steps derived from "Step N" H2 headings)
howto: z.boolean().optional(),
}),
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkMermaid, [remarkAdmonition, { typeMap: admonitionTypeMap }]],
// Dark code blocks in BOTH light & dark page modes — pair a dark Shiki
// theme (light text) with the dark code surface so text never goes
// dark-on-dark. (Fumadocs' default dual github-light/dark put DARK text in
// light mode, which is invisible on our forced-dark code background.)
rehypeCodeOptions: {
themes: {
light: 'github-dark',
dark: 'github-dark',
},
},
},
});