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

Adding a prefix to with_toc_data to avoid ID collisions #792

Open
collimarco opened this issue Oct 14, 2024 · 0 comments
Open

Adding a prefix to with_toc_data to avoid ID collisions #792

collimarco opened this issue Oct 14, 2024 · 0 comments

Comments

@collimarco
Copy link

I would like to enable with_toc_data, so that I can link to specific sections. However the ID of a section could in theory collide with an id that already exists in the layout or other parts of the page. How can I prevent that?

Is it possible to optionally add a prefix to the IDs generated by with_toc_data ?

Example:

  • Title: My Example Section
  • Current: #my-example-section
  • Expected: #blog-my-example-section or #docs-my-example-section
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

No branches or pull requests

1 participant