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

Feature request: "on this page" mini TOC #12

Closed
noamtamim opened this issue Jul 30, 2017 · 4 comments
Closed

Feature request: "on this page" mini TOC #12

noamtamim opened this issue Jul 30, 2017 · 4 comments

Comments

@noamtamim
Copy link

noamtamim commented Jul 30, 2017

As seen on Leap Day.

I prefer this theme visually, but the on-this-page TOC is a nice touch.

@stale
Copy link

stale bot commented Oct 24, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 24, 2017
@stale
Copy link

stale bot commented Dec 23, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 23, 2017
@stale stale bot closed this as completed Dec 30, 2017
@jmini
Copy link

jmini commented Aug 17, 2019

In the "Leap Day" theme, this is solved with javascript (based on jquery).
Relevant parts:

An empty list is added in the layout file:

https://github.com/pages-themes/leap-day/blob/af5c3638f65f80f9baca1ece30017cf55f91cf1e/_layouts/default.html#L40-L42

And a script loads the TOC and add the list items:

https://github.com/pages-themes/leap-day/blob/af5c3638f65f80f9baca1ece30017cf55f91cf1e/assets/js/main.js#L16-L28

This script is registered in layout:

https://github.com/pages-themes/leap-day/blob/af5c3638f65f80f9baca1ece30017cf55f91cf1e/_layouts/default.html#L9-L10


See also this pages-themes/cayman#16 (comment) where {:toc} is mentioned.

@jmini
Copy link

jmini commented Aug 18, 2019

I did not managed to use the {:toc} inside the default.html layout file, even with the inputs from jekyll/jekyll#5843


At the end I have switched to jekyll-toc, a solution built on top of the liquid templating engine.

This works well on GitHub pages.

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

No branches or pull requests

3 participants