@contentina/zod
v0.0.6
Published
Zod schema helpers for Contentina projects.
Readme
📐 @contentina/zod
Zod schema helpers for Contentina projects.
Optional s namespace with content-friendly validators — slugs, ISO dates, markdown fields, TOC items, and reading metadata. Re-exports Zod so you can use one import in contentina.config.ts.
Install
bun add @contentina/zod zodQuick start
import { defineCollection } from "@contentina/core";
import { s } from "@contentina/zod";
const posts = defineCollection({
source: "content/{en,de}/posts/*.{md,mdx}",
schema: s.object({
title: s.string(),
slug: s.slug(),
date: s.isodate().optional(),
body: s.markdown(),
}),
});Core Contentina only requires the Standard Schema contract — @contentina/zod is a convenience layer, not a hard dependency.
Helpers
| Helper | Use for |
| --------------------------------- | ------------------------- |
| s.slug() | URL-safe slugs |
| s.isodate() / s.isodatetime() | ISO date strings |
| s.markdown() / s.mdx() | Raw source fields |
| s.image() / s.file() | Asset path strings |
| s.tocItem() | Table-of-contents entries |
| s.readingMetadata() | Word count / reading time |
Part of Contentina · npm
