### Bug description

Quarto websites [allow for hybrid navigation](https://quarto.org/docs/websites/website-navigation.html#hybrid-navigation) where a sidebar shows up for just one section of a site, based on a shared title and filename in the YAML settings.

However, in cases where only one hybrid sidebar is defined, the sidebar appears on all pages on the site. 

Here's a minimal reprex:

(I'm using macOS 12.4, R 4.2.1, Quarto 1.0.38, and RStudio 2022.07.1 Build 554)

---

Assume a folder structure like this, with 4 `.qmd` files:

```
.
├── _quarto.yml
├── hybrid-navigation-testing.Rproj
├── about.qmd
├── index.qmd
└── subsection
    ├── index.qmd
    └── thing1.qmd
```

**/index.qmd**

````
---
title: Hybrid sidebar example
---

This is a Quarto website.

To learn more about Quarto websites visit <https://quarto.org/docs/websites>.

```{r}
1 + 1
```
````

**/about.qmd**

```
---
title: "About"
---

About this site
```

**/subsection/index.qmd**

```
---
title: Some subsection
---

Blah
```

**/subsection/thing1.qmd**

```
---
title: Thing 1
---

Blah
```

---

Using this `_quarto.yml` file should theoretically produce a standard navbar with a sidebar that only appears when looking at the subsection page, given that the sidebar shares the `subsection/index.qmd` file

``` yaml
project:
  type: website

website:
  title: Testing
  navbar:
    background: primary
    left:
      - text: "Home"
        file: index.qmd
      - text: "Subsection"
        file: subsection/index.qmd
      - about.qmd

  sidebar:
    - title: "Subsection"
      style: "docked"
      background: light
      contents:
        - subsection/index.qmd
        - subsection/thing1.qmd

format:
  html:
    theme: cosmo
```

The sidebar appears on all pages, though, like the home page here:

<img width="1111" alt="image" src="https://user-images.githubusercontent.com/73663/184452566-7787fcd3-3f68-4ade-89a1-f67d2a7b1c08.png">

The only way I've found to get a page-specific hybrid sidebar is to define an empty second sidebar:

``` yaml
project:
  type: website

website:
  title: Testing
  navbar:
    background: primary
    left:
      - text: "Home"
        file: index.qmd
      - text: "Subsection"
        file: subsection/index.qmd
      - about.qmd

  sidebar:
    - title: "Subsection"
      style: "docked"
      background: light
      contents:
        - subsection/index.qmd
        - subsection/thing1.qmd

    - title: "Placeholder thing"

format:
  html:
    theme: cosmo
```

This forces the hybrid sidebar to only show up on the subsection page and not on the other sidebar-less pages, as expected:

<img width="1165" alt="image" src="https://user-images.githubusercontent.com/73663/184452495-d08f6e8a-b859-4919-a5f0-5bbb38a212e3.png">



### `quarto check` Output

Here are the results from `quarto check`:

``` bash
[✓] Checking Quarto installation......OK
      Version: 1.0.38
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.13
      Path: /opt/homebrew/opt/python@3.9/bin/python3.9
      Jupyter: 4.11.1
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

And here are the results from `quarto tools check`:

``` bash
[✓] Inspecting tools

Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Not installed     ---           v2022.08
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
dragonstyle
2022-08-12T22:31:29Z
andrewheiss
bug
v1.3
closed
Hybrid sidebar doesn't work when only using one hybrid section
https://github.com/quarto-dev/quarto-cli/issues/1853