Make post name support chinese

This commit is contained in:
vio.ao 2024-06-17 16:09:58 +08:00
parent 3ea21afa0d
commit e35b76249c

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[] } }) {