Skip to content

Commit 3ea21af

Browse files
committed
Revert "Make post name support chinese"
This reverts commit b61c582.
1 parent b61c582 commit 3ea21af

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import 'css/prism.css'
22
import 'katex/dist/katex.css'
3-
import {components} from '@/components/MDXComponents'
4-
import {MDXLayoutRenderer} from 'pliny/mdx-components'
5-
import {allCoreContent, coreContent, sortPosts} from 'pliny/utils/contentlayer'
6-
import type {Authors, Blog} from 'contentlayer/generated'
7-
import {allAuthors, allBlogs} from 'contentlayer/generated'
3+
4+
import PageTitle from '@/components/PageTitle'
5+
import { components } from '@/components/MDXComponents'
6+
import { MDXLayoutRenderer } from 'pliny/mdx-components'
7+
import { sortPosts, coreContent, allCoreContent } from 'pliny/utils/contentlayer'
8+
import { allBlogs, allAuthors } from 'contentlayer/generated'
9+
import type { Authors, Blog } from 'contentlayer/generated'
810
import PostSimple from '@/layouts/PostSimple'
911
import PostLayout from '@/layouts/PostLayout'
1012
import PostBanner from '@/layouts/PostBanner'
11-
import {Metadata} from 'next'
13+
import { Metadata } from 'next'
1214
import siteMetadata from '@/data/siteMetadata'
13-
import {notFound} from 'next/navigation'
15+
import { notFound } from 'next/navigation'
1416

1517
const defaultLayout = 'PostLayout'
1618
const layouts = {
@@ -73,7 +75,9 @@ export async function generateMetadata({
7375
}
7476

7577
export const generateStaticParams = async () => {
76-
return allBlogs.map((p) => ({slug: p.slug.split('/').map(name => decodeURI(name))}))
78+
const paths = allBlogs.map((p) => ({ slug: p.slug.split('/') }))
79+
80+
return paths
7781
}
7882

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

0 commit comments

Comments
 (0)