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 paths = siteConfig.page.blogLinks.map((nav) => {
|
||||||
const href = nav.href.replace('/blog', '')
|
const href = nav.href.replace('/blog', '')
|
||||||
return {
|
return {
|
||||||
params: { path: href === '' ? undefined : href },
|
params: {
|
||||||
|
path: href === '' ? undefined : href.replace(/^\/+|\/+$/g, ''),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return paths
|
return paths
|
||||||
|
@ -29,6 +31,8 @@ function activeLink(pathname: string) {
|
||||||
pageNav={true}
|
pageNav={true}
|
||||||
pageOperate={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">
|
<div class="flex flex-col gap-2 sm:flex-row sm:gap-4 flex-wrap mb-8">
|
||||||
{
|
{
|
||||||
siteConfig.page.blogLinks.map((nav) => (
|
siteConfig.page.blogLinks.map((nav) => (
|
||||||
|
|
Loading…
Reference in a new issue