🐛 fix rss bugs

This commit is contained in:
Sindre Kjelsrud 2023-12-10 00:17:01 +01:00
parent c26c1da4ed
commit d9dfec6dbc
2 changed files with 17 additions and 22 deletions

View file

@ -1,16 +1,9 @@
import { defineCollection, z } from 'astro:content';
import { rssSchema } from '@astrojs/rss';
const blog = defineCollection({
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
description: z.string(),
// Transform string to Date object
pubDate: z
.string()
.or(z.date())
.transform((val) => new Date(val))
}),
schema: rssSchema
});
export const collections = { blog };