20 lines
670 B
TypeScript
20 lines
670 B
TypeScript
import { defineCollection, z } from 'astro:content';
|
|
import { glob } from 'astro/loaders';
|
|
import { docsLoader } from '@astrojs/starlight/loaders';
|
|
import { docsSchema } from '@astrojs/starlight/schema';
|
|
import { docsPath } from './docs-path';
|
|
|
|
export const collections = {
|
|
docs: defineCollection({ loader: docsLoader({ generateId: docsPath }), schema: docsSchema() }),
|
|
blog: defineCollection({
|
|
loader: glob({ pattern: '*.md', base: './src/content/blog' }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
date: z.coerce.date(),
|
|
draft: z.boolean().default(false),
|
|
ogImage: z.string().optional(),
|
|
}),
|
|
}),
|
|
};
|