File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,23 +17,25 @@ export const dynamicParams = false
1717
1818export async function generateMetadata ( { params } : Props ) : Promise < Metadata > {
1919 const { tag } = await params
20+ const decodedTag = decodeURIComponent ( tag )
2021 return {
21- title : `#${ tag } ` ,
22- description : `标签「${ tag } 」下的所有文章` ,
22+ title : `#${ decodedTag } ` ,
23+ description : `标签「${ decodedTag } 」下的所有文章` ,
2324 }
2425}
2526
2627export default async function TagPage ( { params } : Props ) {
2728 const { tag } = await params
28- const posts = getPostsByTag ( tag )
29+ const decodedTag = decodeURIComponent ( tag )
30+ const posts = getPostsByTag ( decodedTag )
2931
3032 if ( posts . length === 0 ) notFound ( )
3133
3234 return (
3335 < div >
3436 < div className = "mb-8" >
3537 < h1 className = "text-sm font-mono" style = { { color : 'var(--color-fg-muted)' } } >
36- #{ tag }
38+ #{ decodedTag }
3739 < span className = "ml-2 opacity-50" > { posts . length } </ span >
3840 </ h1 >
3941 </ div >
You can’t perform that action at this time.
0 commit comments