fix: Updated rss.xml #5
72bd8461
1 file(s) · +13 −13
| 2 | 2 | import { getCollection } from "astro:content"; |
|
| 3 | 3 | import siteMeta from "@/site-config"; |
|
| 4 | 4 | ||
| 5 | - | export const get = async () => { |
|
| 6 | - | const posts = await getCollection("post"); |
|
| 5 | + | export async function GET() { |
|
| 6 | + | const posts = await getCollection("post"); |
|
| 7 | 7 | ||
| 8 | - | return rss({ |
|
| 9 | - | title: siteMeta.title, |
|
| 10 | - | description: siteMeta.description, |
|
| 11 | - | site: import.meta.env.SITE, |
|
| 12 | - | items: posts.map((post) => ({ |
|
| 13 | - | title: post.data.title, |
|
| 14 | - | description: post.data.description, |
|
| 15 | - | pubDate: post.data.publishDate, |
|
| 16 | - | link: post.slug, |
|
| 17 | - | })), |
|
| 18 | - | }); |
|
| 8 | + | return rss({ |
|
| 9 | + | title: siteMeta.title, |
|
| 10 | + | description: siteMeta.description, |
|
| 11 | + | site: "https://stevedylan.dev", |
|
| 12 | + | items: posts.map((post) => ({ |
|
| 13 | + | title: post.data.title, |
|
| 14 | + | description: post.data.description, |
|
| 15 | + | pubDate: post.data.publishDate, |
|
| 16 | + | link: post.slug, |
|
| 17 | + | })), |
|
| 18 | + | }); |
|
| 19 | 19 | }; |