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

Problems with anchors with the same name in a page #4755

Open
huygur opened this issue Dec 12, 2024 · 3 comments
Open

Problems with anchors with the same name in a page #4755

huygur opened this issue Dec 12, 2024 · 3 comments
Labels
component:docs Documentation improvements, including new or updated content kind/bug Issues related with bugs in the documentation

Comments

@huygur
Copy link
Contributor

huygur commented Dec 12, 2024

This might be an edge case, but when a subtitle with the same name appears multiple times on a single page, the anchor links are not correctly assigned.

In my case, there are 2 Limitations subtitles in this page , and I recently added a new one.
There are all in the same level (2nd level title), so at a first glance nothing seems wrong.
But in such cases, the links are generated as follows:

https://docs.camunda.io/docs/components/modeler/web-modeler/play-your-process/#limitations
https://docs.camunda.io/docs/components/modeler/web-modeler/play-your-process/#limitations-1

The issue arises when I add a new title and subtitle (subtitle named "Limitations" again) above the existing ones. In this case, the existing links will be updated as follows:

#limitations --> #limitations-1
#limitations-1 --> #limitations-2

and my new anchor link will be: #limitations

I solved this problem by defining a custom anchor in this docs page, so if I referred these links somewhere, they won't be altered.
But I think we need to pay attention to this somehow.

@huygur huygur added the best-practices Issues related to the Best Practices section of the docs label Dec 12, 2024
@huygur
Copy link
Contributor Author

huygur commented Dec 12, 2024

Not sure if I used the correct label, please correct if it is wrong 😄

@akeller akeller added kind/bug Issues related with bugs in the documentation component:docs Documentation improvements, including new or updated content and removed best-practices Issues related to the Best Practices section of the docs labels Dec 12, 2024
@akeller
Copy link
Member

akeller commented Dec 12, 2024

@camunda/tech-writers @pepopowitz, I listed this as a bug, but I can see us addressing this in a couple of different ways. Can you please decide on the best path forward for situations like this?

@pepopowitz
Copy link
Collaborator

I don't believe we have enough infrastructure or tooling to support the canonicalization/preservation of anchors on pages, nor do I think we should, as I think the effort would far exceed the benefit. To me the contract in terms of preserving a URL for SEO/bookmark purposes does not include anchors. In other words, I don't think we or docusaurus are doing anything wrong by adjusting the anchors of a page when the content itself changes.

My stance on the best path forward is not to worry about this situation. If in the moment a person feels like adjusting in the way described in the body, great...but I don't see it as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:docs Documentation improvements, including new or updated content kind/bug Issues related with bugs in the documentation
Projects
None yet
Development

No branches or pull requests

3 participants