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

Hide/show sidebar through a configuration option #708

Closed
1 task done
Rubonnek opened this issue Sep 14, 2022 · 2 comments
Closed
1 task done

Hide/show sidebar through a configuration option #708

Rubonnek opened this issue Sep 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Rubonnek
Copy link
Contributor

Prerequisites

  • I have searched for duplicate or closed feature requests

Proposal

Currently there's no way to provide a configuration value to hide or show the whole sidebar on a first-page load. It would be nice to have that feature specifically for pages where the content does not fit properly on the screen.

Motivation and context

See the site parameters documentation page for example.

On a 1080p monitor, the contents of that page do not properly fit the screen. However, if one were to toggle the sidebar through the sidebar toggler, the page fits rather well and looks much better with the sidebar disabled by default on that page.

Perhaps a configuration such as sidebar.masterToggle or sitebar.enable would suffice. Something like the following:

sitebar:
  masterToggle: false # Disables sidebar on the right side of the screen

Also, in #336 the original intention of the archives layout was for it to not have a sidebar -- a decision I agree with and currently it doesn't seem possible to disable the sidebar through the configuration files, or by modifying the frontMatter in of content/archives/_index.md for example. It would also be nice to be able to disable the sidebar on other places such as the landing page.

@Rubonnek Rubonnek added the enhancement New feature or request label Sep 14, 2022
@razonyang
Copy link
Owner

razonyang commented Sep 15, 2022

I think it's reasonable to have a parameter for disabling sidebar on some pages, i.e. archives pages, landing pages.

But the default value sidebar toggle doesn't make much sense, since the sidebar toggle should be enabled by default in large screen, and disabled by default in medium screen. It would become too complex if the toggle value depends on the screen width.

@Rubonnek
Copy link
Contributor Author

Rubonnek commented Sep 15, 2022

But the default value sidebar toggle doesn't make much sense, since the sidebar toggle should be enabled by default in large screen, and disabled by default in medium screen. It would become too complex if the toggle value depends on the screen width..

I agree. Sorry, I basically meant what you did recently.

Also, I didn't understand the page parameters until now -- I didn't know how to use them before. Your recent patches is what I was looking for! Thank you!

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

No branches or pull requests

2 participants