Blindly hope that sorting the RSS feed differently works
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
import rss from "@astrojs/rss";
|
import rss from "@astrojs/rss";
|
||||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
|
import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
|
||||||
|
|
||||||
const posts = Object.values(import.meta.glob("../posts/*.md", { eager: true }));
|
let posts = Object.values(import.meta.glob("../posts/*.md", { eager: true }));
|
||||||
|
|
||||||
|
posts = posts.sort(
|
||||||
|
(a, b) =>
|
||||||
|
new Date(b.frontmatter.updated || b.frontmatter.added).valueOf() -
|
||||||
|
new Date(a.frontmatter.updated || a.frontmatter.added).valueOf()
|
||||||
|
);
|
||||||
|
|
||||||
export const get = () =>
|
export const get = () =>
|
||||||
rss({
|
rss({
|
||||||
@@ -13,7 +19,11 @@ export const get = () =>
|
|||||||
link: `/post/${post.frontmatter.slug}`,
|
link: `/post/${post.frontmatter.slug}`,
|
||||||
title: post.frontmatter.title,
|
title: post.frontmatter.title,
|
||||||
pubDate: post.frontmatter.added,
|
pubDate: post.frontmatter.added,
|
||||||
|
description: post.frontmatter.description,
|
||||||
content: post.compiledContent(),
|
content: post.compiledContent(),
|
||||||
|
customData: {
|
||||||
|
updated: post.frontmatter?.updated,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user