Proof of concept work for a developer hub using submodules from external repos to render a unified documentation site using the markdown files pulled from each submodule.
The developer hub website is built using Docusaurus, a modern static website generator.
To clone the repository with the files in the submodules:
git clone --recurse-submodules https://github.com/MitchellShiell/bridge.git
After cloning, you may wish to fetch and update the submodules:
git fetch --recurse-submodules
To fire up the local development server first install all the required dependencies
npm ci
Then run the following command:
yarn start
Important
Docusaurus requires node version 18 or higher
To fetch the latest changes for all submodules:
git fetch --recurse-submodules
There are two ways to add new submodules:
- Update the
.gitmodules
file manually then run:
git submodule update --recursive --remote
Or
- Run the following command:
git submodule add -b <branchName> <GitHub repository URL> module_name
Note
You can also define a specific branch you would like to pull either from the command line or updating the .gitmodules with an branch = branchName
entry
To pull the latest changes for all submodules, including any new ones:
git submodule update --recursive --remote
When working within a submodule:
cd
ing into any submodule treats it as if you cloned the repo independently- Git operations like branching, adding, and pushing will push to the external repo
- The root directory works within the root project (e.g., the bridge repo) This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Fix found from here: facebook/docusaurus#3272 (comment)