melange-re / melange-re.github.io

Documentation site for Melange
https://melange.re
25 stars 7 forks source link

fix scroll to location hash #170

Closed jchavarri closed 6 months ago

jchavarri commented 6 months ago

Currently, the scroll to location hash is broken due to vitepress doing the scroll before the Switch.vue component has had time to update the global classes that control the visibility of reason and ocaml blocks.

The PR adds a small script that mostly reproduces what Switch.vue is doing, but does so after DOMContentLoaded event, so when vitepress runs the scroll to hash logic, the content is already in its right position.

cc @feihong