quarto-dev / quarto-dev/quarto-cli
Behavior of arrays of sidebars is unclear
@cscheid is already working on this.
Since Jan 20, 2025.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Opening after talking to @cscheid
This may be a bug or documentation issue, but consider this callout on the Webpage Nav docs:
A page that doesn’t appear in any
sidebarwill inherit and display the first sidebar without anidortitle- you can prevent the sidebar from showing on a page by settingsidebar: falsein its front matter.
This implied to me that the sidebar displayed on a page (unless otherwise set with sidebar in the header) would be:
- The sidebar in which it is an element
- If not an element in any sidebar, the first sidebar without a title (or id)
Here's an example that doesn't seem to follow these rules.
Consider this sidebar:
website:
sidebar:
- title: Research
contents:
- project-1.qmd
- project-2.qmd
- title: Teaching
contents:
- course-1.qmd
- course-2.qmd
- contents:
- index.qmd
- about.qmd
I would expect that project-1.qmd would get the "Research" sidebar, and course-1.qmd to get the "Teaching" sidebar. Instead, they both get the last sidebar.
I've documented this example, and many others (some that almost work, some that don't) at: https://github.com/cwickham/sidebar-array?tab=readme-ov-file#sidebar-behavior
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.