How to support shared sidebars #10184
Replies: 2 comments 10 replies
-
It's not ideal to have a common doc bound to 2 distinct sidebars. We have to pick one to display when you browse that doc and it might not be the one you want. You can use a sidebar item of type "ref" so that it appears in a sidebar but that sidebar is not displayed when you browse the doc. https://docusaurus.io/docs/next/sidebar/multiple-sidebars#sidebar-item-ref You can also use |
Beta Was this translation helpful? Give feedback.
-
For anyone looking for the same sort of thing one trick is to add an additional sidebar config which appears last in the last of sidebar configs, with a title such as "Common" (or anything to indicate that it's shared). Then this title will be shown for any shared documents, rather than showing the wrong product category etc. Example: https://docs.certifytheweb.com/ I guess the alternative would have been to generated new routes per sidebar and duplicate each common document under each one, as duplicating an entire document is obviously not the right approach from a maintenance perspective. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I have the following setup
My current problem is that when I'm in the tutorial page (using
tutorialSidebar
) and I presscommonDoc
it will change the first to pages fromdoc1
anddoc2
todoc3
anddoc4
, meaning that the sidebar displayed is theapiSidebar
now.How can I keep the sidebar static when going to the
commonDoc
page? either if I'm in the tutorial or api section I want the first two pages to not change when I selectcommonDoc
.Beta Was this translation helpful? Give feedback.
All reactions