Skip to content

Adding a prefix to with_toc_data to avoid ID collisions #792

Description

@collimarco

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions