Add Markdown blog and FAQ content collections

This commit is contained in:
Kevin
2026-09-02 10:25:49 -04:00
parent e45bbe4111
commit 78cfe0cc71
20 changed files with 176 additions and 27 deletions
+26
View File
@@ -0,0 +1,26 @@
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const blog = defineCollection({
loader: glob({ base: './sites/blog/content/posts', pattern: '**/*.md' }),
schema: z.object({
title: z.string().min(12).max(100),
description: z.string().min(30).max(180),
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
tags: z.array(z.string().min(2).max(32)).min(1).max(4),
draft: z.boolean().default(false),
}),
});
const faq = defineCollection({
loader: glob({ base: './sites/www/content/faq', pattern: '**/*.md' }),
schema: z.object({
question: z.string().min(12).max(180),
category: z.string().min(2).max(48).default('General'),
order: z.number().int().min(0).max(99).default(0),
draft: z.boolean().default(false),
}),
});
export const collections = { blog, faq };