Fixing RSS feed to be in proper order

This commit is contained in:
Timothy Rogers 2025-02-09 10:53:00 -05:00
parent 6773a5be12
commit 3706a8dac2

View file

@ -1,8 +1,10 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
import dayjs from "dayjs";
export async function GET(context) {
const Blog = await getCollection("blog");
Blog.sort((a, b) => dayjs(b.data.published).diff(dayjs(a.data.published)));
return rss({
title: "Hack13 Ramblings",
description: "A fox with a blog, that rambles about tech, games, and life.",