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