mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 02:31:33 +08:00
feat: title is required
This commit is contained in:
@ -11,15 +11,15 @@ const post = defineCollection({
|
||||
type: 'content',
|
||||
schema: () =>
|
||||
z.object({
|
||||
title: z.string().optional(),
|
||||
title: z.string(),
|
||||
description: z.string().optional().nullable(),
|
||||
date: z.union([
|
||||
z.string(),
|
||||
z.date()
|
||||
]).transform((val) => new Date(val)),
|
||||
date: z.union([z.string(), z.date()]).transform((val) => new Date(val)),
|
||||
coverImage: z.string().optional(),
|
||||
draft: z.boolean().default(false),
|
||||
tags: z.union([z.array(z.string()), z.null()]).default([]).transform(removeDupsAndLowerCase),
|
||||
tags: z
|
||||
.union([z.array(z.string()), z.null()])
|
||||
.default([])
|
||||
.transform(removeDupsAndLowerCase),
|
||||
ogImage: z.string().optional(),
|
||||
category: z.string().optional().nullable(),
|
||||
finished: z.boolean().default(false),
|
||||
|
Reference in New Issue
Block a user