You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you open this link, the view you see is this:
Notice that the sidebar is always scrolled to the top. You don't see the currently active page in the sidebar, so you have to scroll down a bit to find it. This is inconvenient, when there is a long sidebar with several sections and you want to discover other pages adjacent to this one within the same section.
Describe the solution you'd like
I think when you open the page, the sidebar should automatically scroll to the active page.
It's possible there could be multiple links to the same page in the sidebar, in which case I think anchoring to the first of them is fine.
Another interesting feature is highlighting the anchored item. This applies both to sidebar and to regular anchors to heareds on the page. See an example how it works in rustdoc. If you click the following link, it'll anchor you to a specific header, and it'll also highlight that header with a short blink: https://doc.rust-lang.org/stable/std/#what-is-in-the-standard-library-documentation, and keeps a persistent dimmed highlighting background color on the header.
Maybe something like this could also be implemented in Vitepress for anchors to headers and in the sidebar.
Is your feature request related to a problem? Please describe.
Suppose I share you a link to vitepress documentation like this: https://vitepress.dev/guide/sitemap-generation.
When you open this link, the view you see is this:
Notice that the sidebar is always scrolled to the top. You don't see the currently active page in the sidebar, so you have to scroll down a bit to find it. This is inconvenient, when there is a long sidebar with several sections and you want to discover other pages adjacent to this one within the same section.
Describe the solution you'd like
I think when you open the page, the sidebar should automatically scroll to the active page.
It's possible there could be multiple links to the same page in the sidebar, in which case I think anchoring to the first of them is fine.
Another interesting feature is highlighting the anchored item. This applies both to sidebar and to regular anchors to heareds on the page. See an example how it works in
rustdoc
. If you click the following link, it'll anchor you to a specific header, and it'll also highlight that header with a short blink: https://doc.rust-lang.org/stable/std/#what-is-in-the-standard-library-documentation, and keeps a persistent dimmed highlighting background color on the header.Maybe something like this could also be implemented in Vitepress for anchors to headers and in the sidebar.
Validations
The text was updated successfully, but these errors were encountered: