Multi-docs with single autogenerated sidebar #11110
-
|
Greetings I have a Docusaurus setup with documentation for a mobile robot. I'm trying to determine the optimal way to version both its hardware and software documentation. Let's assume the following structure:
My goal is to set up independent versioning for the hardware and software sections (since hardware versions differ from software versions) while maintaining a single, unified sidebar. This sidebar should display links to both hardware and software pages, regardless of whether the user is currently viewing a hardware or a software page. I guess it is related to #6588 and #2528 but main problem is to get autogenerated sidebar from one instance to another. Is it possible to do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It's not possible, unfortunately. Plugins are sandboxed, and one docs plugin page doesn't see/receive data from another. If you use 2 docs plugin instances, then the software page can't access the data and render the hardware sidebar items. In the future, with support for React Server Components (tracked in #9089, big 2025 project), we should be able to interleave and render data of multiple plugins more easily, but for now we can't do that. Even in the future, it's likely that such customization would require swizzling and a bit of React code, and does not come out of the box with a simple configuration item. The only options now would be
Note that there's an ambiguity to consider. If you have:
Then if you are on Docusaurus doesn't have a way to know that when browsing software v1.1 docs pages, it should display hardware v2 sidebar items instead of hardware v1 sidebar items. We support various versioning schemes so it wouldn't be easy either to build a heuristic that makes sense for all cases. |
Beta Was this translation helpful? Give feedback.
It's not possible, unfortunately. Plugins are sandboxed, and one docs plugin page doesn't see/receive data from another.
If you use 2 docs plugin instances, then the software page can't access the data and render the hardware sidebar items. In the future, with support for React Server Components (tracked in #9089, big 2025 project), we should be able to interleave and render data of multiple plugins more easily, but for now we can't do that. Even in the future, it's likely that such customization would require swizzling and a bit of React code, and does not come out of the box with a simple configuration item.
The only options now would be