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
8.45k stars 1.96k forks source link

Update contentlayer.config.ts #969

Open emmanuelh-dev opened 1 month ago

emmanuelh-dev commented 1 month ago

To use the TOC (Table of Contents) with the default string, you might encounter an error due to incompatibility with the TOC properties. When attempting to parse it, it may break because it is already a string. However, with these changes, it works fine: image

vercel[bot] commented 1 month ago

@emmanuelh-dev is attempting to deploy a commit to the timlrx's projects Team on Vercel.

A member of the Team first needs to authorize it.

timlrx commented 1 month ago

Hi @emmanuelh-dev, thanks for the PR. Could you give an example where it might break if using a string rather than json?

emmanuelh-dev commented 1 month ago

Hi Tim,

I've added the TOC to every page without using a component, as you can see in the screenshot below:

image

However, this approach caused an issue during the build process. The string used is not compatible, which resulted in the following error:

image

To fix this problem, I changed the type from string to JSON.