From e96c7d89dbc14d0a513eb21ffd68aeebac0517c0 Mon Sep 17 00:00:00 2001 From: grassblock Date: Tue, 26 Aug 2025 21:44:43 +0800 Subject: [PATCH] feat: more tolerable tags options for posts --- src/content/posts/_schemas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/posts/_schemas.ts b/src/content/posts/_schemas.ts index 3337edd..71c03a2 100644 --- a/src/content/posts/_schemas.ts +++ b/src/content/posts/_schemas.ts @@ -9,7 +9,7 @@ export const posts = ({image}) => z.object({ date: z.coerce.date(), updated: z.coerce.date().optional(), categories: z.union([z.array(z.string()), z.string()]).transform(val => Array.isArray(val) ? val : [val]).default(['uncategorized']), - tags: z.array(z.string()).optional(), + tags: z.union([z.array(z.string()), z.string()]).transform(val => Array.isArray(val) ? val : [val]).optional(), cover: image().optional(), author: z.union([z.array(reference('authors')), reference('authors')]).optional(), }); \ No newline at end of file