diff --git a/src/content.config.ts b/src/content.config.ts index 0b82ca4..afe18cf 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -17,7 +17,6 @@ const post = defineCollection({ draft: z.boolean().default(false), banner: z.string().optional(), tags: z.array(z.string()).default([]).transform(removeDupsAndLowerCase), - categories: z.array(z.string()).default([]).transform(removeDupsAndLowerCase), date: z.union([z.string(), z.date()]).transform((val) => new Date(val)), date_modified: z.date().optional(), data_created: z.date().optional(), diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index 3419c6c..751d1e1 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -18,20 +18,24 @@ export const GET = async () => { title: siteConfig.title, description: siteConfig.description, site: import.meta.env.SITE, - items: sortedPosts.map((post) => ({ - title: post.data.title, - description: post.data.description ?? "", - pubDate: post.data.date, - link: `posts/${post.id}/`, - content: post.body - ? sanitizeHtml(parser.render(post.body), { - allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]), - textFilter: function (text: string) { - return text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFFF0-\uFFFF]/g, ""); - }, - }) - : "", - author: siteConfig.author, - })), + items: sortedPosts.map((post) => { + console.log(post.data); + return { + title: post.data.title, + description: post.data.description ?? "", + pubDate: post.data.date, + link: `posts/${post.id}/`, + content: post.body + ? sanitizeHtml(parser.render(post.body), { + allowedTags: sanitizeHtml.defaults.allowedTags.concat(["img"]), + textFilter: function (text: string) { + return text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F\uFFF0-\uFFFF]/g, ""); + }, + }) + : "", + author: siteConfig.author, + category: post.data?.category, + }; + }), }); };