Compare commits

..

2 commits

Author SHA1 Message Date
grassblock
6a2d5fd912 feat: fully dynamic title path 2025-05-16 18:34:08 +08:00
grassblock
77c56236f9 fix: article url in rss 2025-05-16 18:29:15 +08:00
2 changed files with 5 additions and 4 deletions

View file

@ -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;
---
<!doctype html>

View file

@ -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.