-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.config.ts
More file actions
30 lines (28 loc) · 894 Bytes
/
content.config.ts
File metadata and controls
30 lines (28 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
type: 'content',
schema: ({ image }) =>
z.object({
lang: z.enum(['zh', 'en']),
title: z.string(),
description: z.string(),
summary: z.string().optional(),
seoDescription: z.string().optional(),
date: z.coerce.date(),
updated: z.coerce.date().optional(),
tags: z.array(z.string()).default([]),
keywords: z.array(z.string()).default([]),
category: z.string().default('General'),
translationKey: z.string(),
draft: z.boolean().default(false),
social: z
.object({
xPost: z.string().optional(),
linkedinPost: z.string().optional(),
githubDiscussion: z.string().optional()
})
.optional(),
heroImage: image().optional()
})
});
export const collections = { blog };