mkdocs-monorepo-plugin
mkdocs-monorepo-plugin copied to clipboard
Include docs from outside main directory
Lets say I have multiple mkdocs projects on multiple disks. How would I use monorepo to include them in one site. bit like this,
├───A
│ └───src
│ │ mkdocs.yml
│ │
│ └───docs
├───B
│ └───src
│ │ mkdocs.yml
│ │
│ └───docs
└───C
└───monorepo
mkdocs.yml
I the monorepo's yml file I have tried
nav:
- C:
- A: '!include A:/src/mkdocs.yml'
- B: '!include B:/src/mkdocs.yml'
Obviously, both A and B are not in the monorepo root so I have this error
[mkdocs-monorepo] The mkdocs file A:\src\mkdocs.yml is outside of the current directory. Please move the file and try again.
I can't have them all in the same directory. Can we have a config option that allows out of directory includes? I cant use https://github.com/wilhelmer/mkdocs-multirepo because A, B and C are not publicly facing git repos.
At my work, we successfully applied both of the following solutions:
- Symlinks: Create symlinks within C that point to ../A and ../B respectively
- Nested checkouts: Instead of checking out repos in a flat structure, we check them out using this:
- C
- sites
- A
- B
- sites
In fact we have a dedicated root repository whose only job is it to checkout all other repos and which contains the mkdocs with the global navigation. Added benefit: Our deployment pipeline for our docs is running when any of the nested sites has a new commit.
Thanks, I will try the symlinks later!