From 77c56236f932c8e4630b0e5e614935806b68e465 Mon Sep 17 00:00:00 2001 From: grassblock Date: Fri, 16 May 2025 18:29:15 +0800 Subject: [PATCH 1/2] fix: article url in rss --- src/pages/rss.xml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js index 77e0091..c3ba18d 100644 --- a/src/pages/rss.xml.js +++ b/src/pages/rss.xml.js @@ -52,7 +52,7 @@ export async function GET(context) { }, sanitize({ dropElements: ["script", "style"] }), ]); - feedItems.push({ ...post.data, link: `/blog/${post.slug}/`, content }); + feedItems.push({ ...post.data, link: `/post/${post.slug}/`, content }); } // Return our RSS feed XML response. From 6a2d5fd9123bf6287e41973c3a214bbe48e94665 Mon Sep 17 00:00:00 2001 From: grassblock Date: Fri, 16 May 2025 18:34:08 +0800 Subject: [PATCH 2/2] feat: fully dynamic title path --- src/layouts/Layout.astro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 3172c09..b61d8fe 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -14,14 +14,15 @@ interface Props { } const defaultTitle = siteConfig.title -const formattedPath = defaultTitle.toLowerCase().replace(/\s+/g, '-'); +const formattedRootPath = defaultTitle.toLowerCase().replace(/\s+/g, '-'); +const relativePath = Astro.url.pathname +const path = formattedRootPath + (relativePath === '/' ? '' : relativePath) const navBarItems = siteConfig.navBarItems const customFooter = siteConfig.customFooter const nekoType = siteConfig.neko?.type -const { title, path = formattedPath, description = siteConfig.description, ogImage = "" } = Astro.props; -// TODO: make the path dynamic +const { title, description = siteConfig.description, ogImage = "" } = Astro.props; ---