aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
authorPinapelz <donaldshan1@outlook.com>2023-09-08 18:01:35 -0700
committerPinapelz <donaldshan1@outlook.com>2023-09-08 18:01:35 -0700
commit4c04b2b740399e7b810c3a7c2f098ca3301268cd (patch)
tree52b55445a2843b6626c14ce9283d1527b8941682 /src/pages
parent53af37a9adb8194467656f173af0f8bb98bb197e (diff)
sort RSS feed by latest posts first
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/rss.xml.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js
index 7d054b9..9041051 100644
--- a/src/pages/rss.xml.js
+++ b/src/pages/rss.xml.js
@@ -4,6 +4,7 @@ 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());
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
@@ -13,4 +14,4 @@ export async function get(context) {
link: `/blog/${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