-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsource.config.ts
More file actions
59 lines (55 loc) · 1.59 KB
/
Copy pathsource.config.ts
File metadata and controls
59 lines (55 loc) · 1.59 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
import {
defineDocs,
defineConfig,
frontmatterSchema,
} from 'fumadocs-mdx/config';
import { z } from 'zod';
import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins';
import { cloudemuLight } from './lib/shiki-themes';
export const { docs, meta } = defineDocs({
dir: 'content/docs',
docs: {
schema: frontmatterSchema.extend({
// service pages: per-provider service names, rendered as chips
aws: z.string().optional(),
azure: z.string().optional(),
gcp: z.string().optional(),
}),
},
});
// Blog runs on the same MDX pipeline as docs (same Shiki theme + components)
// — no more hand-rolled markdown renderer.
export const { docs: blogDocs, meta: blogMeta } = defineDocs({
dir: 'content/blog',
docs: {
schema: frontmatterSchema.extend({
date: z.string().optional(),
author: z.string().optional(),
}),
},
});
const defaults = rehypeCodeDefaultOptions;
export default defineConfig({
mdxOptions: {
rehypeCodeOptions: {
...defaults,
// The site is light-only. Keep Shiki's dual-theme shape (fumadocs expects
// it) but map BOTH modes to the light palette — otherwise dark-OS visitors
// get the dark (light-coloured) palette on our light code surface, which
// is unreadable.
themes: {
light: cloudemuLight,
dark: cloudemuLight,
},
transformers: [
...(defaults.transformers ?? []),
{
name: 'cloudemu:pre-language',
pre(pre) {
pre.properties['data-language'] = this.options.lang;
},
},
],
},
},
});