Skip to content

Conversation

@mcanouil
Copy link
Contributor

This pull request adds a note and example to the documentation on how to reuse a sidebar for a page. It explains how to specify the sidebar ID in the front matter of a page or in the _metadata.yml file to include a specific sidebar. An example is provided to demonstrate how to include the tutorials sidebar on a page.

@cderv
Copy link
Collaborator

cderv commented Jan 10, 2025

/deploy-preview

@github-actions
Copy link
Contributor

🚀 Deployed on https://deploy-preview-1329.quarto.org

@cderv
Copy link
Collaborator

cderv commented Jan 14, 2025

Before merging, just to clarify: My understanding from https://deploy-preview-1329.quarto.org/docs/websites/website-navigation.html#hybrid-navigation is that the correct sidebar should be set on all page listed in contents

  sidebar:
    - id: <id>
      contents: 
        # navigation items

Isn't this working ?

I mean setting explicitly sidebar in .qmd files shouldn't be needed, and if it is not working it seems like an issue to me 🤔

@mcanouil
Copy link
Contributor Author

mcanouil commented Jan 14, 2025

Where do you see that any contents listed in a sidebar get the sidebar?

Edit: i see but it's not in the part you linked.

A sidebar with an id or title will only be applied to pages within the contents of the sidebar or pages that specify the sidebar id.

This PR is here to illustrate how to add a specific sidebar to any page/directory, regardless of if the page itself is listed in that sidebar, i.e., how to use the defined ID. (edit: thus the second part of the quoted sentence from the documentation).

Edit: i need to move the addition to below the quoted part above. 33bdc4e

@cderv
Copy link
Collaborator

cderv commented Jan 14, 2025

I find it illustrated in the note, but you found a better place yet.
It is also in Charles' answer at quarto-dev/quarto-cli#8117 (reply in thread)

This PR is here to illustrate how to add a specific sidebar to any page/directory

I know. I wanted to be sure we are not missing an issue but thinking it was a documentation problem only.

Both way work, and using sidebar on document is not documented so it should be definitly as Charle explained it.

Using sidebar inside a document is only useful for content not listed in quarto yaml though.

@cderv
Copy link
Collaborator

cderv commented Jan 14, 2025

/deploy-preview

@github-actions
Copy link
Contributor

🚀 Deployed on https://deploy-preview-1329.quarto.org

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I understand no specific issue with sidebar dectection, and just documentation addition! Awesome. I struggled in the past to fix a sidebar id issue, and feared there was a new one 😅

@cderv cderv merged commit e9a7924 into quarto-dev:main Jan 14, 2025
3 checks passed
@github-actions
Copy link
Contributor

Successfully created backport PR for prerelease:

@mcanouil
Copy link
Contributor Author

So I understand no specific issue with sidebar dectection, and just documentation addition! Awesome. I struggled in the past to fix a sidebar id issue, and feared there was a new one 😅

None that I am aware of.

@mcanouil mcanouil deleted the docs/reuse-sidebar branch January 14, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants