Open NickHeiner opened 4 years ago
Hello,
What I do is using relative links between the files in the different repositories. So, for example, if you have the following files:
main/index.md
API v1/index.md
API v2/index.md
This is how I would write a link to the API index files on main/index.md
:
- [API v1](../API v1/index.md)
- [API v2](../API v2/index.md)
When you write the relative links like this, MkDocs is able to correctly link the generated files and also validates if the links are correct during the build.
How would this look like with docs directories?
@whiskeysierra Did you find out a way to achieve this?
Looks like #94 should resolve this :)
Considering a mono repo project, the only (current) way to fix this was to use the site_name to be able to link from one site to the other within a markdown file. if we have
project_a
|_mkdocs.yml
|_docs
|_a_file.md
project_b
|_mkdocs.yml
|_docs
|_b_file.md
where mkdocs.yml on both only have a site_name: My Project A Docs
and site_name: My Project B Docs
respectively (no nav
)
from b_file.md I could do
[link to a file](/my-project-a-docs/a_file
I tried using relative markdown links across mkdocs projects, but this would only render locally (in markdown previewers), but it wouldn't by any means render the correct website. I could use regular markdown links within the same project.
The above "problem" is that I'm using the site link rather than the relative markdown path. Is this the expected outcome? For now I'll tell developers to disregard using relative links across projects and use the site_name instead, but is this the intended way moving forward?
The example shows how to create a site like:
Is it possible to link between docs in
API v1
andAPI v2
?