lichx-blog/content.config.ts

26 lines
879 B
TypeScript
Raw Normal View History

2025-08-17 17:22:06 +08:00
import { defineContentConfig, defineCollection, z } from '@nuxt/content';
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
id: z.string(),
title: z.string(),
description: z.string().optional(),
created_at: z.string().datetime(),
published_at: z.string().datetime().optional(),
draft: z.boolean().default(false),
updated_at: z.array(z.string().datetime()).default([]),
tags: z.array(z.string()).default([]),
tech_stack: z.array(z.string()).default([]),
tech_stack_percent: z.array(z.number()).default([]),
tech_stack_icon_names: z.array(z.string()).default([]),
tech_stack_theme_colors: z.array(z.string()).default([]),
rawbody: z.string(),
}),
}),
},
});