From e1ec4a112907f4aebad56b2b388eceb3969e6e88 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 12 Jun 2026 18:30:42 -0700 Subject: unify microblog --- src/pages/rss.xml.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/pages/rss.xml.js') diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js index 6fed721..83f4946 100644 --- a/src/pages/rss.xml.js +++ b/src/pages/rss.xml.js @@ -3,15 +3,21 @@ import { getCollection } from 'astro:content'; import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; export async function GET(context) { - const posts = await getCollection('blog'); - posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime()); + const blogPosts = await getCollection('blog'); + const microPosts = await getCollection('micro'); + const posts = [...blogPosts, ...microPosts]; + posts.sort( + (a, b) => + new Date(b.data.pubDate).getTime() - + new Date(a.data.pubDate).getTime() + ); return rss({ title: SITE_TITLE, description: SITE_DESCRIPTION, site: context.site, items: posts.map((post) => ({ ...post.data, - link: `/blog/${post.slug}/`, + link: `/${post.collection}/${post.slug}/`, })), }); -} \ No newline at end of file +} -- cgit v1.2.3