Skip to content

Commit 5a15d1a

Browse files
committed
rename schema to docSchema
1 parent f1d0760 commit 5a15d1a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/collections.ts

+8-12
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ export const headingSchema = z.array(
2424
}),
2525
)
2626

27+
export const docSchema = {
28+
frontmatter: frontmatterSchema,
29+
headings: headingSchema,
30+
}
31+
2732
export const AriaDocsCollection = new Directory({
2833
path: "content/docs/aria-docs",
2934
// base path is required, otherwise we can't build the correct slugs in the `generateStaticParams`
3035
basePath: "aria-docs",
3136
loaders: {
3237
mdx: withSchema(
33-
{
34-
frontmatter: frontmatterSchema,
35-
headings: headingSchema,
36-
},
38+
docSchema,
3739
(path) => import(`@content/docs/aria-docs/${path}.mdx`),
3840
),
3941
},
@@ -45,10 +47,7 @@ export const RenounDocsCollection = new Directory({
4547
basePath: "renoun-docs",
4648
loaders: {
4749
mdx: withSchema(
48-
{
49-
frontmatter: frontmatterSchema,
50-
headings: headingSchema,
51-
},
50+
docSchema,
5251
(path) => import(`@content/docs/renoun-docs/${path}.mdx`),
5352
),
5453
},
@@ -60,10 +59,7 @@ export const TestCollection = new Directory({
6059
basePath: "test-collection",
6160
loaders: {
6261
mdx: withSchema(
63-
{
64-
frontmatter: frontmatterSchema,
65-
headings: headingSchema,
66-
},
62+
docSchema,
6763
(path) => import(`@content/docs/test-collection/${path}.mdx`),
6864
),
6965
},

0 commit comments

Comments
 (0)