Search code examples
quarto

Quarto Hybrid Navigation Sidebar Always Shown


I adapted the YAML file for hybrid navigation as outlined in the Quarto documentation: Hybrid Navigation . Unfortunately, the Tutorial sidebar always appears, not just when I click on the Tutorial link in the navbar, which is not my intended behavior. Regrettably, the Quarto documentation I referred to doesn't explain how the platform determines when to display a sidebar. I assume it checks whether a file is listed in the sidebar. However, if that were the case, the sidebar shouldn't appear when I click on "About," but it does.

    project:
      type: website
      resources: tutorial.pdf, tutorial.R

    website:
      title: "test.org"

      navbar:
        background: secondary
        search: true
        left:
          - text: "About"
            file: index.qmd
          - text: "Tutorial"
          
      sidebar:
        - title: "Tutorial"
          style: "docked"
          background: light
          contents:
            - tutorial/before.qmd
            - tutorial/loading_data.qmd
            

    format:
      html:
        theme: cosmo
        css: styles.css
        toc: true

Solution

  • See this note in the Website Navigation documentation that you provided, it is under the "Hybrid Navigation" section:

    enter image description here.

    So, in your index.qmd, at the top it has to be

    ---
    title: "About"
    sidebar: false