From 0b1da73d1646705ac6ecc9af87781eee461e3536 Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Thu, 14 Aug 2025 18:22:05 +0100 Subject: [PATCH] Move rss to be index of /rss file Will add /rss/style endpoint --- src/components/Base.astro | 2 +- src/pages/{rss.xml.ts => rss/index.ts} | 5 +++-- src/pages/rss/style.ts | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename src/pages/{rss.xml.ts => rss/index.ts} (89%) create mode 100644 src/pages/rss/style.ts diff --git a/src/components/Base.astro b/src/components/Base.astro index 5a9aaa8..ffa0cb0 100644 --- a/src/components/Base.astro +++ b/src/components/Base.astro @@ -27,7 +27,7 @@ const title = Astro.props.title rel="alternate" type="application/rss+xml" title="Your Site's Title" - href={new URL("rss.xml", Astro.site)} + href={new URL("rss", Astro.site)} /> diff --git a/src/pages/rss.xml.ts b/src/pages/rss/index.ts similarity index 89% rename from src/pages/rss.xml.ts rename to src/pages/rss/index.ts index b618c3e..6405fac 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss/index.ts @@ -25,8 +25,9 @@ export const GET: APIRoute = async ({ site }) => { /* its ssg so dynamic imports are fine. ../../ is bc it includes src/components so we need to go to project root */ - /* @vite-ignore */ - const { default: Component } = await import(`../../${post.filePath}`); + const { default: Component } = await import( + /* @vite-ignore */ `../../../${post.filePath}` + ); const content = await container.renderToString(Component); return { ...res, content: content }; diff --git a/src/pages/rss/style.ts b/src/pages/rss/style.ts new file mode 100644 index 0000000..e69de29 -- 2.51.2