This commit is contained in:
parent
fb5a3b8093
commit
58d8b661a8
1055 changed files with 116254 additions and 89 deletions
20
sites/reviews/src/pages/rss.xml.js
Normal file
20
sites/reviews/src/pages/rss.xml.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import rss from "@astrojs/rss";
|
||||
import { getCollection } from "astro:content";
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
|
||||
import { ACTIVE_BLOG_SITE } from "../blog-sites.js";
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = (await getCollection(ACTIVE_BLOG_SITE.key)).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
|
||||
return rss({
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
...post.data,
|
||||
link: `/${post.id}/`,
|
||||
})),
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue