Skip to content
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

inject_anchors customization feature #43

Open
SpaceOyster opened this issue Jan 16, 2018 · 9 comments
Open

inject_anchors customization feature #43

SpaceOyster opened this issue Jan 16, 2018 · 9 comments

Comments

@SpaceOyster
Copy link

SpaceOyster commented Jan 16, 2018

I think it would be great to give user an opportunity to customize injected anchors, for example by adding toc-injected-anchors.html template to _includes directory, the content of which will override default string.

@JadedBlueEyes
Copy link

JadedBlueEyes commented Dec 14, 2018

I'd specificaly love to be able to at least have a custom class, as i don't use octicons, I use feathericons.

@JadedBlueEyes
Copy link

@toshimaru it seems like you intend to do this anyway? #24 (comment)

@gandalf3
Copy link

I've submitted a PR for this feature: #75
If anyone here is still looking for this, I'd be interested to hear any feedback. Thanks :)

@IHIutch
Copy link

IHIutch commented Apr 4, 2019

Following up here because I'd like to have this feature as well!

@etsauer
Copy link

etsauer commented Apr 10, 2019

If nothing else, being able to specify a class on the anchor tags would be useful in enabling things like Bootstrap Scrollspy.

The PR above appears to solve this and other problems, though having a config option for the class would still be nice to provide consistency with the custom list item classes.

@toshimaru
Copy link
Owner

toshimaru commented Apr 10, 2019

I'm still considering whether jekyll-toc supports custom anchor feature.
I'd like to recommend to use anchor.js. It might be more flexible solution.

Does it sound good to you?

ref. https://www.bryanbraun.com/anchorjs/

@IHIutch
Copy link

IHIutch commented Apr 11, 2019

Like etsauer mentioned, just having a config option would be really useful if you're trying to maintain the scope of this plugin. Seems like in order to get Bootstrap 4's Scrollspy to work, you really only need '.nav-link' or '.list-group-item' on the TOC anchors.

AnchorJS doesn't seem like it has a graceful way of handling this, but I'm not super familiar

@toshimaru
Copy link
Owner

FYI, {% toc %} + anchor.js sample project:

railsdoc/railsdoc.github.io: Rails API Documentation.

@JadedBlueEyes
Copy link

JadedBlueEyes commented Apr 26, 2019

TBH, I'd prefer a solution in the jekyll stage, to minimise in JS - only fuctionality and load times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants