diff --git a/src/pages/blog/[...path].astro b/src/pages/blog/[...path].astro index 228f4b3..2813405 100644 --- a/src/pages/blog/[...path].astro +++ b/src/pages/blog/[...path].astro @@ -8,7 +8,9 @@ export async function getStaticPaths() { const paths = siteConfig.page.blogLinks.map((nav) => { const href = nav.href.replace('/blog', '') return { - params: { path: href === '' ? undefined : href }, + params: { + path: href === '' ? undefined : href.replace(/^\/+|\/+$/g, ''), + }, } }) return paths @@ -29,6 +31,8 @@ function activeLink(pathname: string) { pageNav={true} pageOperate={true} > +
posts:{posts}
+
path:{path}
{ siteConfig.page.blogLinks.map((nav) => (