Repository navigation
Replies: 5 comments 21 replies
|
Hi If you have multiple repos, each with a lot of docs, it may be better to split your site into multiple subparts for build time reasons, having Vercel deploy previews etc... It is then theoretically possible to assemble all those sites under a unique domain, each site having a subpath. You can share the Docusaurus config/CSS across sites so that one site looks like the others I'd suggest the following structure:
With Vercel you can use rewrites (https://vercel.com/docs/cli#project-configuration/rewrites) so that one subpath is routed to a subdomain. This can allow you to assemble multiple sites/subdomains under a single domain.
The navbar allows you to link to any URL. We have some components like the version dropdown that you may not be able to use: if you are on the Android website, Docusaurus doesn't know about the iOS doc versions and can't render a dropdown dynamically (but you can create it statically through config)
Algolia should be able to index multiple sites assembled as a portal. The config allows you to provide start_urls and sitemaps, and the crawler probably can figure things out just by following links. The question is also: once this data is indexed, can you query it correctly? It may not work exactly like you want by default, but you can swizzle some parts to adapt our default logic to your need. Particularly the "contextual search" system is opinionated and may not work for your use-case , but you can swizzle There are questions to answer, like:
This use-case totally makes sense, and we can assist you with this so don't hesitate to ask questions here or on Discord. If this is hard to set up, we'll figure out a way to make it easier. I don't think this strategy has been used a lot so far and I'd like to have some nice "portal" sites in our showcase as a demonstration of what is technically possible. Note:
|
|
Many thanks for your helpful ideas and suggestions! I will look into it more deeply and give it a try. I am very sure I will have further questions upcoming. One is that we might have to add authentication. With Next.js it would be fairly simple to add some basic auth, e.g. using middleware. It seems one could solve it using AWS Amplify. I have no clear idea yet how to add it to such portal architecture using different Vercel deployments. Do you? |
|
Now, that the deployment was successfull I am wondering how to distribute my docusaurus configs and other assets like custom.css oder favicon across the repos. Regarding the docusaurus config, I should be able to create one universal config that just depends on certain environment variables that need to be added to each dedicated deployment. Do you have an idea how to maintain this centrally and push to repos on new changes? |
|
A colleague of mine discovered that the Escaping from Spa Redirects functionality allows us to serve multiple Docusaurus builds by putting the build content into subdirectories of the portal's Docusaurus Are there any downsides to using the |
|
Just saying thank you @slorber and @ptrhck for your discussion and the example you worked on the repo https://github.com/ptrhck/docusaurus-portal, it helps me a lot with the new Turborepo features. |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am considering to use docusaurus for documenting multiple repos and been thinking about two different strategies to achieve this. I have different teams with different repos and each should document allongside their code but maintain one docs site.
First, create a docs repo that pulls the mardown files from alle repos using docusaurus-plugin-remote-content. I see a few drawbacks here:
Second idea to adress all the above issues, is to deploy one docusaurus instance for each repository (If that is possible on Vercel, e.g. mydomain.com/docs1, mydomain.com/docs2 ). Here, a few questions that come up for this solution:
I am looking forward get some ideas from you!
Cheers!
All reactions