Skip to content

Commit 7f9fd72

Browse files
define the fumadocs source
1 parent ac41025 commit 7f9fd72

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/source.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
import { docs, meta } from '@/.source';
21
import { createMDXSource } from 'fumadocs-mdx';
32
import { loader } from 'fumadocs-core/source';
3+
import type { InferMetaType, InferPageType } from 'fumadocs-core/source';
4+
import { docs, meta, blogPosts, pagesPosts } from '@/.source';
45

56
export const source = loader({
67
baseUrl: '/docs',
7-
source: createMDXSource(docs, meta),
8+
source: createMDXSource(docs, meta)
89
});
10+
11+
export const blog = loader({
12+
baseUrl: '/blog',
13+
source: createMDXSource(blogPosts, []),
14+
});
15+
16+
export const pageLists = loader({
17+
baseUrl: '/pages',
18+
source: createMDXSource(pagesPosts, [])
19+
});
20+
21+
export type DocsPage = InferPageType<typeof source>;
22+
export type DocsMeta = InferMetaType<typeof source>;
23+
export type BlogPage = InferPageType<typeof blog>;
24+
export type BlogMeta = InferMetaType<typeof blog>;
25+
export type PagesType = InferPageType<typeof pageLists>;
26+
export type PagesMeta = InferMetaType<typeof pageLists>;

0 commit comments

Comments
 (0)