This repository has no description
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445import { z } from 'zod'
const seoSchema = z .object({ title: z.string().optional(), description: z.string().optional(), image: z .object({ src: z.string(), alt: z.string().optional() }) .optional(), pageType: z.enum(['website', 'article']).default('website'), }) .partial()
export const postFrontmatterSchema = z.object({ title: z.string(), slug: z.string().optional(), subtitle: z.string().optional(), author: z.string().optional(), excerpt: z.string().optional(), publishDate: z.coerce.date(), updatedDate: z.coerce.date().optional(), isFeatured: z.boolean().default(false), tags: z.array(z.string()).default([]), seo: seoSchema.optional(),})
export const projectFrontmatterSchema = z.object({ title: z.string(), description: z.string().optional(), publishDate: z.coerce.date(), isFeatured: z.boolean().default(false), seo: seoSchema.optional(),})
export const pageFrontmatterSchema = z.object({ title: z.string(), description: z.string().optional(), subtitle: z.string().optional(), seo: seoSchema.optional(),})
export type PostFrontmatter = z.infer<typeof postFrontmatterSchema>export type ProjectFrontmatter = z.infer<typeof projectFrontmatterSchema>export type PageFrontmatter = z.infer<typeof pageFrontmatterSchema>