pages-themes / leap-day

Leap day is a Jekyll theme for GitHub Pages
https://pages-themes.github.io/leap-day/
Creative Commons Zero v1.0 Universal
203 stars 483 forks source link

Is there a way to not add h3 to ToC? #40

Closed tboerger closed 4 years ago

tboerger commented 4 years ago

I'm using this nice simple theme for automaitcally generated documentation, this works great so far except for pages the document lots of options, you can see it at https://machippie.github.io/system/.

Is there a way to limit the ToC only to h1 and h2? Or to get a better scrolling behavior for the sidebar?

FriedrichWeinmann commented 4 years ago

Hi @tboerger ,

been playing around with this myself and found a way to do this (in a rather convenient manner, too). Basically, in your own repository create a file like this: assets/js/main.js Then copy the content from here: https://github.com/pages-themes/leap-day/blob/master/assets/js/main.js

With that you have a local override of the main.js file and can edit the logic! (Downside: If this ever gets updated, you don't automatically receive the update)

For example, you can now replace this:

$("section h1, section h2, section h3").each(function(){

with

$("section h1, section h2").each(function(){

And thus exclude h3 headers from being included.

tboerger commented 4 years ago

Not the most elegant solution, but at least a workaround for that.

FriedrichWeinmann commented 4 years ago

btw, I just finished setting up my project, in case you find it useful:

https://github.com/ActiveDirectoryManagementFramework/ActiveDirectoryManagementFramework.github.io

http://admf.one

What I changed from the default template:

The only files I needed to touch for all that were default.html and main.js.

stale[bot] commented 4 years ago

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.