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

strange behavior when toc-location is left #11770

Open
ceisenhauer opened this issue Jan 2, 2025 · 0 comments
Open

strange behavior when toc-location is left #11770

ceisenhauer opened this issue Jan 2, 2025 · 0 comments
Labels
bug Something isn't working html Issues with HTML and related web technology (html/css/scss) layout

Comments

@ceisenhauer
Copy link

Bug description

i'm not sure if some of this behavior is intentional, but it seemed a bit odd to me.

i have a quarto website where toc-location is set to left. for certain pages (for example, about), i don't need a toc and so i turn it off in the page specific yaml. in doing this, i noticed that the page content became noticeably off-centered to the right:
Image

i realized that this is because setting the page specific toc to false removes the quarto-margin-sidebar (where a toc on the right would normally appear) but not the quarto-sidebar that is added when toc-location: left (see image below). this would explain why removing the page specific toc on a website with toc-location: right leaves the resulting content centered (expected behavior) but a page with toc-location: left does not (unexpected behavior).
Image

in full honesty, i actually expected that when toc-location: left the quarto-margin-sidebar would simply be moved to the left side of the page rather than having a second sidebar added instead. the current system causes content to be centered in a different way on pages with left hand vs right hand tocs even on the pages where the toc is present, which seems a bit surprising.

is this behavior expected?

Steps to reproduce

files to reproduce the above screenshot example.

index.qmd:

---
title: "Example"
toc: false
---

Lorem ipsum odor amet, consectetuer adipiscing elit. Integer eleifend eu pretium curabitur posuere ante hac. Justo rutrum interdum in faucibus curabitur litora justo nibh pretium. Nisl nisi erat ullamcorper sodales curae. Lectus vestibulum proin accumsan placerat etiam lectus lacinia mattis. Mus montes convallis faucibus maximus integer accumsan. Parturient maecenas at felis posuere suspendisse tellus ultricies euismod. Fermentum vestibulum platea justo potenti; vestibulum natoque adipiscing. Egestas vel suscipit et diam diam nullam egestas dolor.

_quarto.yml:

project:
  type: website

website:
  title: "sidebar_example"
  navbar:
    left:
      - href: index.qmd
        text: Home

format:
  html:
    theme: cosmo
    toc: true
    toc-location: left

Expected behavior

by default i would expect that setting toc-location: left moves quarto-margin-sidebar to the left side of the page rather than adding a second sidebar. even if adding a second sidebar is deliberate, i would expect that toc: false on a specific page removes both sidebars to produce an output equivalent to having toc: false on a page of website where toc-location: right.

Actual behavior

moving toc-location to the left (for overall website) adds a second sidebar on the left side of the page rather than moving the existing sidebar to the left. when toc: false for a specific page on a website with left-hand side tocs only the right hand sidebar is removed, resulting in off-center page content.

Your environment

  • ide: vim 8.1 (rendering done in terminal)
  • os: linux ubuntu 20.04
  • quarto: 1.6.39

Quarto check output

Image

@ceisenhauer ceisenhauer added the bug Something isn't working label Jan 2, 2025
@mcanouil mcanouil added html Issues with HTML and related web technology (html/css/scss) layout labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working html Issues with HTML and related web technology (html/css/scss) layout
Projects
None yet
Development

No branches or pull requests

2 participants