Revert "Make post name support chinese"

This reverts commit b61c582259ebea05d6c81764657b5eaf8834f096.
This commit is contained in:
vio.ao 2024-06-17 16:09:34 +08:00
parent b61c582259
commit 3ea21afa0d

View File

@ -1,16 +1,18 @@
import 'css/prism.css'
import 'katex/dist/katex.css'
import {components} from '@/components/MDXComponents'
import {MDXLayoutRenderer} from 'pliny/mdx-components'
import {allCoreContent, coreContent, sortPosts} from 'pliny/utils/contentlayer'
import type {Authors, Blog} from 'contentlayer/generated'
import {allAuthors, allBlogs} from 'contentlayer/generated'
import PageTitle from '@/components/PageTitle'
import { components } from '@/components/MDXComponents'
import { MDXLayoutRenderer } from 'pliny/mdx-components'
import { sortPosts, coreContent, allCoreContent } from 'pliny/utils/contentlayer'
import { allBlogs, allAuthors } from 'contentlayer/generated'
import type { Authors, Blog } from 'contentlayer/generated'
import PostSimple from '@/layouts/PostSimple'
import PostLayout from '@/layouts/PostLayout'
import PostBanner from '@/layouts/PostBanner'
import {Metadata} from 'next'
import { Metadata } from 'next'
import siteMetadata from '@/data/siteMetadata'
import {notFound} from 'next/navigation'
import { notFound } from 'next/navigation'
const defaultLayout = 'PostLayout'
const layouts = {
@ -73,7 +75,9 @@ export async function generateMetadata({
}
export const generateStaticParams = async () => {
return allBlogs.map((p) => ({slug: p.slug.split('/').map(name => decodeURI(name))}))
const paths = allBlogs.map((p) => ({ slug: p.slug.split('/') }))
return paths
}
export default async function Page({ params }: { params: { slug: string[] } }) {