fix non-english tags filter failed, display error

This commit is contained in:
Marino 2023-08-23 17:00:11 +08:00
parent 3c09e66a18
commit 19ce00d58b

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(