Something went wrong. Try again.
New TLE Community website using Eleventy. tlecommunity.com
Something went wrong. Try again.
1234567891011121314151617181920import { z } from 'zod'
// Draft content, validate `draft` front matterexport default function () { return function (data) { // Note that drafts may be skipped in a preprocessor (see eleventy.config.js) // when doing a standard build (not --serve or --watch) let result = z .object({ title: z.coerce.string().nonempty(), draft: z.coerce.boolean().default(false), }) .safeParse(data)
if (result.error) { throw result.error } }}