@@ -24,16 +24,18 @@ export const headingSchema = z.array(
24
24
} ) ,
25
25
)
26
26
27
+ export const docSchema = {
28
+ frontmatter : frontmatterSchema ,
29
+ headings : headingSchema ,
30
+ }
31
+
27
32
export const AriaDocsCollection = new Directory ( {
28
33
path : "content/docs/aria-docs" ,
29
34
// base path is required, otherwise we can't build the correct slugs in the `generateStaticParams`
30
35
basePath : "aria-docs" ,
31
36
loaders : {
32
37
mdx : withSchema (
33
- {
34
- frontmatter : frontmatterSchema ,
35
- headings : headingSchema ,
36
- } ,
38
+ docSchema ,
37
39
( path ) => import ( `@content/docs/aria-docs/${ path } .mdx` ) ,
38
40
) ,
39
41
} ,
@@ -45,10 +47,7 @@ export const RenounDocsCollection = new Directory({
45
47
basePath : "renoun-docs" ,
46
48
loaders : {
47
49
mdx : withSchema (
48
- {
49
- frontmatter : frontmatterSchema ,
50
- headings : headingSchema ,
51
- } ,
50
+ docSchema ,
52
51
( path ) => import ( `@content/docs/renoun-docs/${ path } .mdx` ) ,
53
52
) ,
54
53
} ,
@@ -60,10 +59,7 @@ export const TestCollection = new Directory({
60
59
basePath : "test-collection" ,
61
60
loaders : {
62
61
mdx : withSchema (
63
- {
64
- frontmatter : frontmatterSchema ,
65
- headings : headingSchema ,
66
- } ,
62
+ docSchema ,
67
63
( path ) => import ( `@content/docs/test-collection/${ path } .mdx` ) ,
68
64
) ,
69
65
} ,
0 commit comments