Merge pull request #692 from chasingboy95/tag-match-display-fix

fix non-english tags filter failed, display error
This commit is contained in:
Timothy 2023-08-25 09:22:45 +08:00 committed by GitHub
commit 9eb8876eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ import { genPageMetadata } from 'app/seo'
import { Metadata } from 'next'
export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> {
const tag = params.tag
const tag = decodeURI(params.tag)
return genPageMetadata({
title: tag,
description: `${siteMetadata.title} ${tag} tagged content`,
@ -31,7 +31,7 @@ export const generateStaticParams = async () => {
}
export default function TagPage({ params }: { params: { tag: string } }) {
const { tag } = params
const tag = decodeURI(params.tag)
// Capitalize first letter and convert space to dash
const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1)
const filteredPosts = allCoreContent(