fix: fix nav link href
This commit is contained in:
parent
f3aaa2d9b1
commit
cbe8ad7f7b
1 changed files with 5 additions and 1 deletions
|
@ -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}
|
||||
>
|
||||
<div>posts:{posts}</div>
|
||||
<div>path:{path}</div>
|
||||
<div class="flex flex-col gap-2 sm:flex-row sm:gap-4 flex-wrap mb-8">
|
||||
{
|
||||
siteConfig.page.blogLinks.map((nav) => (
|
||||
|
|
Loading…
Reference in a new issue