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

scrollable sticky toc (enhancement request ) #1851

Closed
kulbhushanchand opened this issue Sep 26, 2018 · 5 comments
Closed

scrollable sticky toc (enhancement request ) #1851

kulbhushanchand opened this issue Sep 26, 2018 · 5 comments

Comments

@kulbhushanchand
Copy link
Contributor

In reference to closed issue on this repo - Link

The asked person had made a custom fix.

However If I may request for this feature in the theme, because having lengthy table of contents overflowed from the page and are not reachable.

@mmistakes - Would you like to introduce it?

@mmistakes
Copy link
Owner

mmistakes commented Sep 26, 2018

Don't know if this could be done gracefully. The right sidebar is a huge hack right now because it supports Markdown auto TOCs and a Liquid helper that creates the TOC.

The placement of the HTML is more flexible with the Liquid helper method, but styling it in a way to not break Kramdown TOCs is challenging.

I prefer the pattern of not sticking the TOC and having it scroll with the content. For documentation heavy sites the left nav sidebar is a better place for adding waypoints.

I'm willing to bet most people ignore the sidebar anyways. There's likely few people who are going to be bouncing around multiple headings on a single page. Sticky sidebars and "back to top" links are things people like to add to their site just because they can.

But I don't think they add value to most users, other than clutter up the page more.

@kulbhushanchand
Copy link
Contributor Author

kulbhushanchand commented Sep 26, 2018

You had me convinced about the added visual clutter because of table of contents. Personally I too give less attention to them. However this may be a dormant feature in the theme. Also the bug in the current toc implementation (see the last paragraph of this comment).

My main motive was to get your attention to this closed issue - link1
where the person had implimented the same on this page - link2 . It seems like he has implimented it very easily.

You can see in link 2, he have implemented the scrollable toc. Check this commit
and the following consecutive commits you can decipher the css changes made by him.

Again I would say that the present system of toc in the theme have problem displaying large number of headings in the post.
### To see the problem - You can try to add a lot of headings in the post and in yaml add toc_sticky: true. In this case the table of content will overflow from the page and the last enteries on the list of toc will not be accessible.

@mmistakes
Copy link
Owner

Link2 is super buggy for me. There's all sorts of screen flashes and inconsistencies with how the page scrolls, don't think that's a particularly good solution.

As far as right sidebars that get cutoff. This is one of the reasons I was hesitant to add a sticky behavior. If your body content is shorter than the height of the table of contents, it's going to extend beyond the viewport.

Either turn off the stickiness or limit what headlines are used to make it shorter.

@kulbhushanchand
Copy link
Contributor Author

Thanks for the pointer to limit headlines.

@stale
Copy link

stale bot commented Oct 27, 2018

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.

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

2 participants