A Zod schema that describes the metadata for a post.
import * as z from 'zod';
export default z.object({
/* Page and SEO title. */
title: z.string().min(1),
/* SEO description. */
description: z.string().min(1),
/* Author ID. */
author: z.string().optional(),
/* YYYY-mm-dd. */
publishedDate: z.iso.date(),
/* Set to false to unpublish post. */
published: z.boolean().optional(),
/* Tag IDs. */
tags: z.array(z.string()).optional(),
ogImageUrl: z.url().optional()
});
Note that publishedDate is in local system time, which is UTC when you build in the cloud.