-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Support sidebars with links to anchors in the same page #344
Comments
I would suggest this be auto generated from the markdown content. Something like the following
And display an icon like ⚓ next to any of these. |
I can work on enabling this as a config option as discussed in babel/website#1582 Live demo of proposed UI: https://deploy-preview-1582--babel-new.netlify.com/docs/en/index.html With the new option set to on, the html for the on page navigation will be generated from h2s and h3s in the markdown, and on big screens the main sidebar will switch to fixed position and the new sidebar will show up as well. I'm thinking of making this a progressive enhancement only in browsers that @support the css "position: sticky" property instead of using polyfills. |
Hi @microbouji. Thanks! We have PR #349 that I would love for you to take a look at to see if it meets your standard for this feature. If so, we could use that (or make minor improvements). If not, would love to see what you come up with. |
Hi @JoelMarcey! That's a nice alternative and should probably be the default as it doesn't change the layout from fixed to full width. The separate sidebar that I proposed above could then be enabled with an option for folks who have long doc pages with many subheaders. Option could look like this:
I should have a PR tomorrow and we can iterate there more. Even if you don't end up needing the separate sidebar, the function to generate links from the headers can be reused even in the other PR. |
@microbouji By the way, I am loving the new Babel site. You all have done really good work. |
I believe this feature is live after #524. @microbouji correct me if I'm wrong 😄 |
Is this a bug report?
No. Feature request
Have you read the [Contributing Guidelines]
Why, yes, I have :)
Environment
N/A
Steps to Reproduce
N/A
Expected Behavior
Have a sidebar with links that don't go to different pages, but rather goes to anchors within the same page.
Actual Behavior
N/A
Reproducible Demo
N/A
The text was updated successfully, but these errors were encountered: