diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-06-12 18:30:42 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-12 18:30:42 -0700 |
| commit | e1ec4a112907f4aebad56b2b388eceb3969e6e88 (patch) | |
| tree | 04008fb1a9c4e757507f9c7acf7d1f54ea39f364 /src/pages/rss.xml.js | |
| parent | 1b076495515ac3206c00c268e75643723a3999a5 (diff) | |
Diffstat (limited to 'src/pages/rss.xml.js')
| -rw-r--r-- | src/pages/rss.xml.js | 14 |
1 files changed, 10 insertions, 4 deletions
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 +} |
