Closed z2015 closed 11 months ago
Someone is attempting to deploy a commit to a Personal Account owned by @timlrx on Vercel.
@timlrx first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
tailwind-nextjs-starter-blog | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 14, 2023 3:35am |
I noticed that with this modification, the "tag" in params will be encoded twice in the production environment. Thus, it needs to be decoded twice to restore its normal Chinese display.
export default function TagPage({ params }: { params: { tag: string } }) {
+ const tag = decodeURI(decodeURI(params.tag))
// Capitalize first letter and convert space to dash
const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1)
const filteredPosts = allCoreContent(
sortPosts(allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag)))
)
return <ListLayout posts={filteredPosts} title={title} />
}
@klaaay @timlrx z2015:feat/support-chinese-tag this pr in Dev mode work good but when i deploy to vercel, it takes mistake, make Chinese tag error, url= tag/页面 will show blank page, blogs do not list. restore this change and fallback last version, it works good. https://www.animeirl.top/tags/%E5%B7%A5%E5%85%B7
For chinese tag name in devlopment mode will get error below:
Error: Page "/tags/[tag]/page" is missing param "/tags/%E6%97%A5%E8%AE%B0" in "generateStaticParams()", which is required with "output: export" config.
Should be fixed with encodeURI method.