feat(content): add draft support for content collections
This commit introduces a draft system for the 'events' and 'news' collections. A `draft` boolean field has been added to the content schema, and frontend queries are now updated to only fetch and display content where `draft` is `false`. This allows content to be created and saved without being publicly visible, improving the publishing workflow.
This commit is contained in:
@@ -12,6 +12,7 @@ export default defineContentConfig({
|
||||
date: z.coerce.date(),
|
||||
location: z.string(),
|
||||
cover: z.string().url(),
|
||||
draft: z.boolean().optional().default(false)
|
||||
}),
|
||||
}),
|
||||
// 新闻集合
|
||||
@@ -31,6 +32,7 @@ export default defineContentConfig({
|
||||
seoTitle: z.string().optional(),
|
||||
seoDescription: z.string().optional(),
|
||||
ogImage: z.string().optional(),
|
||||
draft: z.boolean().optional().default(false)
|
||||
}),
|
||||
}),
|
||||
// 名人堂
|
||||
|
||||
Reference in New Issue
Block a user