hugo-book icon indicating copy to clipboard operation
hugo-book copied to clipboard

[Feature] Add a button to hide/expand the page toc

Open ikingye opened this issue 4 years ago • 7 comments

Add a button to hide/expand the page toc on the right.

ikingye avatar Oct 10 '20 09:10 ikingye

Hi! Can you please give example for use-case? It is collapsible for mobile users, but I don't see much reason to collapse it for desktop.

alex-shpak avatar Oct 11 '20 10:10 alex-shpak

On a screen like the 13-inch MacBookPro, because of the menu on the left and the toc on the right, the content in the middle are too narrow. If we can click to hide the toc on the right, the middle content can be wider.

ikingye avatar Oct 13 '20 05:10 ikingye

@alex-shpak Like @ikingye says, please add buttons for collapsing the left sidebar and the TOC sidebar on the right on desktop as well. On small 13 and 14 inch screen laptops, the body of the text is a bit narrow for me. Here's an example of how it messes up my table. The row elements wrap which look weird. Obviously, this problem goes away on larger screens with better resolution.

2021-01-23T21:31:56,099525047+05:30

Another reason that I can think of for doing this is enhancing the immersive experience while reading an article, somewhat similar to zen mode in popular text editors. This happens naturally on mobile but doesn't happen on desktop. Most of the time a user spends on a page will be on the body of the article rather than on the sidebar content.

ghost avatar Jan 23 '21 16:01 ghost

Hi! Will see, right now I don't have a good place for such buttons to nicely put it into layout. I plan some rework of left-top part including moving languadge switch there, so maybe after that change, but can't promise.

alex-shpak avatar Jan 26 '21 17:01 alex-shpak

I would love a button like this. My site, https://millmint.net, uses Hugo Book as a platform for storytelling. A toggle for menu and toc for better readability would be fantastic.

MelonKony avatar Mar 25 '21 04:03 MelonKony

This would be nice on my sites as tables often do not fit which require me to disable the table of contents.

Phosp avatar Mar 26 '21 21:03 Phosp

+1

nianjiang avatar Jul 14 '23 02:07 nianjiang