timlrx / tailwind-nextjs-starter-blog

This is a Next.js, Tailwind CSS blogging starter template. Comes out of the box configured with the latest technologies to make technical writing a breeze. Easily configurable and customizable. Perfect as a replacement to existing Jekyll and Hugo individual blogs.
https://tailwind-nextjs-starter-blog.vercel.app/
MIT License
7.36k stars 1.84k forks source link

Blog title contain comma will cause 404 #952

Open JcobCN opened 4 days ago

JcobCN commented 4 days ago

Describe the bug Mdx title contain comma will cause 404

To Reproduce Steps to reproduce the behavior:

just add some comma in Mdx file title, like this:

---
title: sushiswap MCF v1,v2 MiniChef合约解读
date: '2023-02-28 04:19:00'
tags: ['crypto','code']
draft: false
---

...some contents.

between in 'v1' and 'v2', and will see this page 404.

Expected behavior correctly display, not 404

Screenshots image

System Info (if dev / build issue):

Browser Info (if display / formatting issue):

Additional context I add console.log in /app/blog/[...slug]/page.tsx function Page()

sortedCoreContents.forEach((b)=>{
    if (b.slug.includes('sushi')){
    console.log(b.slug)
    console.log(b.filePath)}
  })

you'll see the same slug print twice. but i not familiar with js/ts.

image

I use / instead of , to avoid this.