Fuma Content

Frontmatter

Fuma Content has built-in support for frontmatter validation using Zod.

Usage

Install zod.

Terminal
pnpm i zod

Pass your schema through the schema option.

import entry from "content";
import { z } from "zod";
import { document } from "fuma-content";
 
export const documents = document(entry, {
  schema: z.object({
    title: z.string(),
  }),
});

Fuma Content loves type safety, the info property in each document will be inferred to the schema type you have passed.

On this page