feat: more modern way to use 'reference' to get authors
This commit is contained in:
parent
9ff40d1e9e
commit
9ecf25f3ab
4 changed files with 21 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
|||
import { z } from 'astro:content';
|
||||
import { z, reference } from 'astro:content';
|
||||
|
||||
export const posts = ({ image }) => z.object({
|
||||
title: z.string(),
|
||||
|
@ -8,5 +8,5 @@ export const posts = ({ image }) => z.object({
|
|||
categories: z.array(z.string()).default(['uncategorized']),
|
||||
tags: z.array(z.string()).optional(),
|
||||
cover: image().optional(),
|
||||
author: z.string().optional(),
|
||||
author: reference('authors').optional(),
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue