mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-23 02:31:31 +08:00
feat: rss add category
This commit is contained in:
@ -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(),
|
||||
|
@ -18,7 +18,9 @@ export const GET = async () => {
|
||||
title: siteConfig.title,
|
||||
description: siteConfig.description,
|
||||
site: import.meta.env.SITE,
|
||||
items: sortedPosts.map((post) => ({
|
||||
items: sortedPosts.map((post) => {
|
||||
console.log(post.data);
|
||||
return {
|
||||
title: post.data.title,
|
||||
description: post.data.description ?? "",
|
||||
pubDate: post.data.date,
|
||||
@ -32,6 +34,8 @@ export const GET = async () => {
|
||||
})
|
||||
: "",
|
||||
author: siteConfig.author,
|
||||
})),
|
||||
category: post.data?.category,
|
||||
};
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user