-
Notifications
You must be signed in to change notification settings - Fork 16
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
Anchor links highlight wrong heading in TOC nav #291
Comments
Hello Phil! I agree that we can improve the precision of the scrollspy, but let's say the bootstrap JS I am using for this is not very reliable in general (see also #178 ). With the latest version the precision of scrolling towards a heading got greatly improved, but the scrollspy is still working in the same way when the page would scroll to a heading more in the middle of the page. Personally I think the anchors should really not be used in the side navigation .. I was getting dizzy navigating to the website with all the scrolling going on haha. Is there a reason why they are still there? I know I am deflecting the original question, but it seems that the website could get improved easily by having better defined subpages than everything on one page where is linked too from many different places. Also make sure the sidebar is always linking to the exact url, so the sidebar highlighting works. Also how coes that within assets the user gets linked to General attributes? Sorry I was trying to understand the structure, you can ignore my comments! |
To answer specific to your question. I would not want to add official support for anchors in the sidebar. But we can reshape the issue to make sure when people follow from scratch the link: https://docs-testing.seek4science.org/help/user-guide/general-attributes#sops, the correct TOC item is highlighted |
Also the fact that the sidebar does not highlight anchor links correctly should be a giveaway that the theme is not made for it! |
Looks a lot better! I just notice there is a child item with the same name is the parent item, "Samples". You can put pages behind parent collapsables too if needed. |
Indeed. I wasn't sure about this. All of the other parents / sections do not have their own page, they are just collections of pages. Samples is different as there is a page called Samples. To be consistent with the other sections, I kept the two items labelled Samples but that is a bit confusing in a different way, two links with the same name. Perhaps there is a better label for one of them. |
In my test SEEK docs site, I have some anchor links in the sidebar navigation, for example, from the homepage, expand the 'Assets' sidebar menu and click 'SOPs'. On the next page, the right-side TOC menu has 'Publications' highlighted, which is a different heading to the one selected. The address bar shows the correct URL (in this case, # sops).
It works fine with 'Activities' then 'Events'. It does not work with 'General attributes and links' then 'Sharing', which points instead to 'Publishing' on the TOC most of the time. It works fine if you're already on the parent page.
(I am trying to reduce the amount of these anchor links and duplicated links.)
I think this is a bug in the recent TOC code. I'm using ETT remote version 3.2.0.
The text was updated successfully, but these errors were encountered: