blob: 88291349860a65b011e6de10b1287ca7d870de54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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),
/* description is always used for meta and OG; set false when it should
not also print as a subtitle under the title */
lede: z.boolean().default(true),
ogImage: z.string().optional(),
}),
}),
};
|