Migrate to Astro 5
This commit is contained in:
parent
5d701069e9
commit
bb1e533a00
129 changed files with 1408 additions and 1448 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import rss from "@astrojs/rss";
|
||||
import type { APIRoute } from "astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, render } from "astro:content";
|
||||
import { blogFeedItem, type EntryWithPubDate } from "@utils/feed";
|
||||
|
||||
const MAX_ITEMS = 8;
|
||||
|
|
@ -22,7 +22,7 @@ export const GET: APIRoute = async ({ site }) => {
|
|||
xmlns: { atom: "http://www.w3.org/2005/Atom" },
|
||||
customData: `<link href="${new URL("blog", site)}" rel="alternate" type="text/html" /><atom:link href="${new URL("blog/feed.xml", site)}" rel="self" type="application/rss+xml" />`,
|
||||
items: await Promise.all(
|
||||
posts.map(async ({ data, slug, render }) => blogFeedItem(site, data, slug, (await render()).Content)),
|
||||
posts.map(async (post) => blogFeedItem(site, post.data, post.id, (await render(post)).Content)),
|
||||
),
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue