@@ -8,23 +8,29 @@ export const seoSchemaWithoutImage = z.object({
88 type : z . string ( ) . optional ( ) ,
99 keywords : z . string ( ) . optional ( ) ,
1010 canonicalUrl : z . string ( ) . optional ( ) ,
11- twitter : z . object ( {
12- creator : z . string ( ) . optional ( ) ,
13- } ) . optional ( ) ,
11+ twitter : z
12+ . object ( {
13+ creator : z . string ( ) . optional ( ) ,
14+ } )
15+ . optional ( ) ,
1416 robots : z . string ( ) . optional ( ) ,
15- } )
17+ } ) ;
1618
1719const seoSchema = ( image : ImageFunction ) =>
18- z . object ( {
19- image : image ( ) . optional ( ) ,
20- } ) . merge ( seoSchemaWithoutImage ) ;
20+ z
21+ . object ( {
22+ image : image ( ) . optional ( ) ,
23+ } )
24+ . merge ( seoSchemaWithoutImage ) ;
2125
2226const pageCollection = defineCollection ( {
2327 loader : glob ( { pattern : '**/[^_]*.{md,mdx}' , base : './src/content/pages' } ) ,
24- schema : ( { image } ) => z . object ( {
25- title : z . string ( ) ,
26- seo : seoSchema ( image ) ,
27- } ) ,
28+ schema : ( { image } ) =>
29+ z . object ( {
30+ title : z . string ( ) ,
31+ description : z . string ( ) . optional ( ) ,
32+ seo : seoSchema ( image ) ,
33+ } ) ,
2834} ) ;
2935
3036const linkCollection = defineCollection ( {
@@ -61,12 +67,13 @@ const talkCollection = defineCollection({
6167
6268const postCollection = defineCollection ( {
6369 loader : glob ( { pattern : '**/[^_]*.{md,mdx}' , base : './src/content/posts' } ) ,
64- schema : ( { image } ) => z . object ( {
65- title : z . string ( ) ,
66- date : z . date ( ) ,
67- image : image ( ) . optional ( ) ,
68- seo : seoSchema ( image ) ,
69- } ) ,
70+ schema : ( { image } ) =>
71+ z . object ( {
72+ title : z . string ( ) ,
73+ date : z . date ( ) ,
74+ image : image ( ) . optional ( ) ,
75+ seo : seoSchema ( image ) ,
76+ } ) ,
7077} ) ;
7178
7279export const collections = {
0 commit comments