aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/rss.xml.js
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-12 18:30:42 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-12 18:30:42 -0700
commite1ec4a112907f4aebad56b2b388eceb3969e6e88 (patch)
tree04008fb1a9c4e757507f9c7acf7d1f54ea39f364 /src/pages/rss.xml.js
parent1b076495515ac3206c00c268e75643723a3999a5 (diff)
unify microblogHEADmaster
Diffstat (limited to 'src/pages/rss.xml.js')
-rw-r--r--src/pages/rss.xml.js14
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
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage