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, gameFeedItem, storyFeedItem, type EntryWithPubDate } from "@utils/feed";
|
||||
|
||||
const MAX_ITEMS = 8;
|
||||
|
|
@ -36,17 +36,17 @@ export const GET: APIRoute = async ({ site }) => {
|
|||
customData: `<link href="${site}" rel="alternate" type="text/html" /><atom:link href="${new URL("feed.xml", site)}" rel="self" type="application/rss+xml" />`,
|
||||
items: await Promise.all(
|
||||
[
|
||||
stories.map(({ data, slug, render }) => ({
|
||||
date: data.pubDate,
|
||||
fn: async () => storyFeedItem(site, data, slug, (await render()).Content),
|
||||
stories.map((story) => ({
|
||||
date: story.data.pubDate,
|
||||
fn: async () => storyFeedItem(site, story.data, story.id, (await render(story)).Content),
|
||||
})),
|
||||
games.map(({ data, slug, render }) => ({
|
||||
date: data.pubDate,
|
||||
fn: async () => gameFeedItem(site, data, slug, (await render()).Content),
|
||||
games.map((game) => ({
|
||||
date: game.data.pubDate,
|
||||
fn: async () => gameFeedItem(site, game.data, game.id, (await render(game)).Content),
|
||||
})),
|
||||
posts.map(({ data, slug, render }) => ({
|
||||
date: data.pubDate,
|
||||
fn: async () => blogFeedItem(site, data, slug, (await render()).Content),
|
||||
posts.map((post) => ({
|
||||
date: post.data.pubDate,
|
||||
fn: async () => blogFeedItem(site, post.data, post.id, (await render(post)).Content),
|
||||
})),
|
||||
]
|
||||
.flat()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue