Merge pull request #941 from vioao/post_name_support_chinese

Make post name support Non-ASCII characters
This commit is contained in:
Timothy 2024-06-22 17:15:53 +08:00 committed by GitHub
commit 7501b2c135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,9 +75,7 @@ export async function generateMetadata({
}
export const generateStaticParams = async () => {
const paths = allBlogs.map((p) => ({ slug: p.slug.split('/') }))
return paths
return allBlogs.map((p) => ({ slug: p.slug.split('/').map((name) => decodeURI(name)) }))
}
export default async function Page({ params }: { params: { slug: string[] } }) {