There is something really weird with my website, the links in the TableOfContent don’t work.
Sometimes.
But when the screen dimensions go beyond a certain threshold, a media query kicks in and change the layout: fine. there are buttons to make the menu or toc appears, and the menu (all local links but not to the current page) works as intended.
But when I access the toc this way, and click on one of its link, the URL in the URL bar changes, but the page doesn’t actually change at all, I am not sent to the headings (specific id attributes) within the page.
But I verified the href attributes of those toc heading links in either case - normal and small screen layouts - and they indeed are the same, so it boggles my mind !
Same thing with firefox or chromium.
I doubt it’s hugo’s doing since the html code won’t possibly change with a media query or whatnot, but knowing hugo you’ll build the sample repository more easily than people of other forums.
Thanks for your help, so we know if it’s really a bug or I misssed something obvious, as usual. https://drive.google.com/drive/folders/1_CQasJ8S3mizW50EFhlwctn-9Un5vO3m?usp=share_link
Same. Exact. Code. Explain how the way a menu is designed can interfere with normal interaction with html elements, because it sounds like magic to me.
ah, so you mean that the link can’t resolve because the parts of the dom tree they refer to (the <article>) is set on “diplay:none” ?
Ok, I could understand that. But it worked before so I still don’t get it.
And that doesn’t explain why once I went back on the article, hence <article>'s display is normal and the dom part still visible, the URL doesn’t work immediately.
It doesn’t look like a normal behavior, no matter the explanation…
But they’re actually the same dom/html element, just the css layout change, the code doesn’t.
I changed display: none to visibility:collapse and it works !
Of course, it’s logical, with the first property the elements don’t exist anymore. What I needed is to interact with something I do not see but exist, not make elements appear after an interaction like I usually do.
Well I learnt stuff, cool, very interesting, thanks !