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

Move Table of Contents up on mobile view? #382

Closed
Natenom opened this issue Feb 5, 2022 · 2 comments · Fixed by #492
Closed

Move Table of Contents up on mobile view? #382

Natenom opened this issue Feb 5, 2022 · 2 comments · Fixed by #492
Labels
enhancement New feature or request

Comments

@Natenom
Copy link
Contributor

Natenom commented Feb 5, 2022

Is your feature request related to a problem? Please describe.
Current order of Cards in mobile view of a post:

  • Post
  • similiar Posts
  • Comments
  • Author card
  • Table of Contents
  • recents Posts
  • ...

Describe the solution you'd like
"Table of Contents" should be above the Post", not somewhere down the page.

@Natenom Natenom added the enhancement New feature or request label Feb 5, 2022
@razonyang
Copy link
Owner

It's hard to keep it on the right side on desktop and keep it on the top of content on mobile. Unless we output TOC twice(HTML), hide one of them via screen width(CSS), but it'll increase the size of HTML without any benefits. How about placing TOC above of post content on desktop? What do you think? @sagarbehere @Natenom

@sagarbehere
Copy link
Contributor

sagarbehere commented Feb 6, 2022

@razonyang

How about placing TOC above of post content on desktop? What do you think?

Could this be made configurable based on layout type? I understand @Natenom ‘s reasoning and agree that having the toc appear at the top on mobile makes a lot of sense. If the only good way to make that happen is to place the toc above the post content on desktop, then let’s make that an option for some post types… maybe even the default option. However, there are many use cases where it is good to have a sticky toc in the right sidebar for a desktop e.g. for longer posts and documentation pages.

So maybe

  • we can leave the toc in the sidebar for docs layout and place it above the content for other layouts? Alternatively,
  • As long as there are separate/distinct ‘sidebar toc’ and ‘toc above content’ widgets, it would not matter what the defaults are because users can configure and include either one from the *-hooks scripts.

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

Successfully merging a pull request may close this issue.

3 participants