quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.74k stars 305 forks source link

Sidebar options like style can only be set on first sidebar in config #8431

Open machow opened 7 months ago

machow commented 7 months ago

Bug description

Quarto's website navigation docs show an example of a hybrid sidebar, with options like style: docked set on the first sidebar entry:

website:
  title: ProjectX
  navbar:
    background: primary
    search: true
    left:
      - text: "Home"
        file: index.qmd
      - sidebar:tutorials
      - sidebar:howto
      - sidebar:fundamentals
      - sidebar:reference

  sidebar:
    - id: tutorials
      title: "Tutorials"
      style: "docked"
      background: light
      collapse-level: 2
      contents: 
        # navigation items

    - id: howto
      title: "How-To"
      contents:
        # navigation items

    - id: fundamentals
      title: "Fundamentals"
      contents: :
        # navigation items

    - id: reference
      title: "Reference"
      contents: 
        # navigation items

This works. However, it makes all 4 sidebar styles "docked". Specifying style: ... on other entries does not affect the corresponding sidebar.

Steps to reproduce

Create the website corresponding to the quarto example pasted above. Move the style: docked to another sidebar entry. The sidebar will not be docked on any sidebar.

(Note also that the example code above docks the sidebar on all sidebars)

Expected behavior

All sidebars can have any of the sidebar options specified. Options specified for the first sidebar only apply to that sidebar.

Actual behavior

Options like style: set on the first sidebar apply to all. The same option set on others, do not get applied.

Your environment

Mac OS

Quarto check output

Quarto 1.4.549
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.549
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Tex:  (not detected)

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.2
      Path: /Users/machow/.virtualenvs/quartodoc/bin/python3
      Jupyter: 5.5.0
      Kernels: python3, venv-siuba, venv-tidyselect, venv-siuba-docs2, venv-pins-python, venv-shout, venv-vetiver-test, venv-siuba-polars, venv-data-analyses, venv-intro-to-siuba, venv-tidyverse-dashboard-duckdb, venv-gt-python, venv-gh_reader, venv-stadium-economics, venv-vetiver-python, venv-shiny-examples, venv-duckops, venv-quartodoc, venv-pyshiny-site, venv-notes, venv-siuba-docs, venv-siuba-workshop, venv-griffe

[✓] Checking Jupyter engine render....OK
gadenbuie commented 7 months ago

Thanks for creating this issue @machow! The Shiny team is interested in this issue -- we'd like to have a docked sidebar in the Shiny for Python API reference while using a floating sidebar elsewhere on the site.