diff options
| author | Nolawz <Nolawz333@protonmail.com> | 2026-03-13 09:25:54 +0530 |
|---|---|---|
| committer | Nolawz <Nolawz333@protonmail.com> | 2026-03-13 09:25:54 +0530 |
| commit | 90aaf37ff84c49d1bf2716dba89b888b728b737e (patch) | |
| tree | 408051c173ebacb8eedec3e3245699648968c87b | |
| parent | 30a3651c17bfd8a771feaaaa4cb700788b757f80 (diff) | |
Fixed rss link and added events to rss
| -rw-r--r-- | astro.config.ts | 2 | ||||
| -rw-r--r-- | src/pages/rss.xml.ts | 24 |
2 files changed, 18 insertions, 8 deletions
diff --git a/astro.config.ts b/astro.config.ts index 38a6cc1..f0baf81 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -20,7 +20,7 @@ import type { ExpressiveCodeTheme } from 'rehype-expressive-code' import tailwindcss from '@tailwindcss/vite' export default defineConfig({ - site: 'https://astro-erudite.vercel.app', + site: 'https://fosscet.codeberg.page/', integrations: [mdx(), react(), sitemap(), icon()], vite: { plugins: [tailwindcss()], diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index fe7e9d2..9cfd560 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -1,22 +1,32 @@ import { SITE } from '@/consts' import rss from '@astrojs/rss' import type { APIContext } from 'astro' -import { getAllPosts } from '@/lib/data-utils' +import { getAllEvents, getAllPosts } from '@/lib/data-utils' export async function GET(context: APIContext) { try { const posts = await getAllPosts() - - return rss({ - title: SITE.title, - description: SITE.description, - site: context.site ?? SITE.href, - items: posts.map((post) => ({ + const events = await getAllEvents() + const items = [ + ...posts.map((post) => ({ title: post.data.title, description: post.data.description, pubDate: post.data.date, link: `/blog/${post.id}/`, })), + ...events.map((event) => ({ + title: event.data.title, + description: event.data.description, + pubDate: event.data.date, + link: `/events/${event.id}/`, + })) + ] + + return rss({ + title: SITE.title, + description: SITE.description, + site: context.site ?? SITE.href, + items: items }) } catch (error) { console.error('Error generating RSS feed:', error) |
