Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contentlayer.config.ts #969

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emmanuelh-dev
Copy link

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

Copy link

vercel bot commented Jul 14, 2024

@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
Copy link
Owner

timlrx commented Jul 15, 2024

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
Copy link
Author

emmanuelh-dev commented Jul 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants