🐛 fix rss bugs
This commit is contained in:
parent
c26c1da4ed
commit
d9dfec6dbc
2 changed files with 17 additions and 22 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue