Validation
Validate your files via Zod
Usage
The file validation is based on Zod. When an invalid file is detected, it will throw an error immediately.
To customise the schemas, you have to install zod
.
Now you can override or extend the default zod schemas with the schema
option.
Example
Extend the default frontmatter schema:
Typescript
Thanks to the Typescript magic, your custom Zod schema type should be automatically inferred.
Furthermore, you can infer the type of pages and meta files with build-in type helpers of Source API.
Last updated on