-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Rip out the old JS TOC generator and use liquid instead #1909
Conversation
Hey there! Super glad to see you giving my jekyll-toc a try for Travis docs 🙌 I really hope to see this merged! IF you're interested, I'd like to shamelessly advertise my jekyll-anchor-headings project to you. Take the same concepts of how jekyll-toc works but it'll build the anchor headings that are currently being generated by JS on Travis. In your {% include anchor_headings.html html=content anchorClass="toc-anchor" anchorBody="#" %} ...and you'd get the same results as your JS (hopefully). I say hopefully because the anchor project is relatively young and hasn't had as much testing as the jekyll-toc project. So IF you're interested and would like to help me test it and give me feedback, that'd be awesome! |
Hey @allejo Cool that you dropped by. I don't think your anchor plugin gives me anything more than https://kramdown.gettalong.org/options.html#option-auto-ids or am I missing something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
So my anchor plugin would generate this hashtag which is currently being generated through JavaScript. i.e. if you load the page without JS, you don't get the clickable links to skip to a section. Both the toc or the anchor plugins rely on kramdown's |
Also, might I suggest setting Additionally, setting |
@allejo good call on I'm with you now, you're talking about the anchor links on |
Not sure if it'll be of use to you, but I just pushed an update that'll let you restrict which headings will get an anchor (allejo/jekyll-anchor-headings@136d41c); similar to the TOC's |
Hey @allejo Any idea if either of your plugins will chomp leading content that does not have an explicit heading? https://deploy-preview-1909--musing-lamport-7fb66c.netlify.com/user/triggering-builds/ for example has a ton of content before the two headings shown in the toc / page? |
Inspired by #1904 and #1883 but this is something I've wanted to do forever!
Uses https://github.com/allejo/jekyll-toc
This way the link checker will use the same TOC links as people viewing the site, and so we'll all have a better experience.
Current menu style:
https://docs.travis-ci.com/user/customizing-the-build/
As it looks with this PR:
https://deploy-preview-1909--musing-lamport-7fb66c.netlify.com/user/customizing-the-build/
Or with an extra level of nested UL