Skip to content

Commit

Permalink
fix: add missing astro context type
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Mar 29, 2024
1 parent edcb02f commit 8aa9576
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { SITE_DESCRIPTION, SITE_TITLE } from "@/consts";
import rss from "@astrojs/rss";
import type { APIContext } from "astro";
import { getCollection } from "astro:content";

export async function GET(context) {
export async function GET(context: APIContext) {
const posts = await getCollection("blog");
return rss({
title: SITE_TITLE,
description: SITE_DESCRIPTION,
site: context.site,
site: context.site!,
items: posts.map((post) => ({
...post.data,
link: `/blog/${post.slug}/`,
Expand Down

0 comments on commit 8aa9576

Please sign in to comment.