Skip to content

Commit e35b762

Browse files
committed
Make post name support chinese
1 parent 3ea21af commit e35b762

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/blog/[...slug]/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ export async function generateMetadata({
7575
}
7676

7777
export const generateStaticParams = async () => {
78-
const paths = allBlogs.map((p) => ({ slug: p.slug.split('/') }))
79-
80-
return paths
78+
return allBlogs.map((p) => ({ slug: p.slug.split("/").map(name => decodeURI(name)) }));
8179
}
8280

8381
export default async function Page({ params }: { params: { slug: string[] } }) {

0 commit comments

Comments
 (0)