Some checks failed
Docker Deploy / build-and-push (push) Has been cancelled
18 lines
447 B
TypeScript
18 lines
447 B
TypeScript
import { defineCollection, z } from 'astro:content';
|
|
import { glob } from 'astro/loaders';
|
|
|
|
const posts = defineCollection({
|
|
loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/content/posts" }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
pubDate: z.coerce.date(),
|
|
updatedDate: z.coerce.date().optional(),
|
|
tags: z.array(z.string()).default([]),
|
|
}),
|
|
});
|
|
|
|
export const collections = {
|
|
posts,
|
|
};
|