You've already forked zblade.dev
8fd0450b0a
Add @astrojs/rss and update blog, changelog, and RSS pages to use the new content collections configuration path
19 lines
590 B
TypeScript
19 lines
590 B
TypeScript
import { defineCollection } from 'astro:content';
|
|
import { glob } from 'astro/loaders';
|
|
import { z } from 'astro/zod';
|
|
|
|
const blog = defineCollection({
|
|
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
pubDate: z.coerce.date(),
|
|
updatedDate: z.coerce.date().optional(),
|
|
heroImage: z.string().optional(),
|
|
tags: z.array(z.string()).default([]),
|
|
categories: z.array(z.string()).default([]),
|
|
draft: z.boolean().default(false),
|
|
}),
|
|
});
|
|
|
|
export const collections = { blog }; |