Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative links to other markdown pages are not updated after merge #7

Open
mihaipopescu opened this issue May 24, 2018 · 1 comment
Assignees
Milestone

Comments

@mihaipopescu
Copy link

mihaipopescu commented May 24, 2018

Say you have a mkdocs site with a setup.md that links to other windows.md, macosx.md and linux.md files like this:

setup.md

Here you can find the setup instructions for:
- [Windows](windows.md)
- [MacOSx](macosx.md)
- [Linux](linux.md)

When you merge that to any other master site, the references will point to a non-existing location.

The workaround is to have the links that point to the html's instead:

Here you can find the setup instructions for:
- [Windows](windows/index.html)
- [MacOSx](macosx/index.html)
- [Linux](linux/index.html)

... but that will break the static markdown files making them aware that they will be compiled to html at one point.

Would be nice if mkdocs-merge would do this automatically (and be aware of some other relative links to other directory structure).

Also, the problematic is extended for paragraph bookmarks (index.html#topic1).

How can we solve that in a more consistent way to make all files agnostic of where they are being used? I think this is an open question for later.

@ovasquez ovasquez self-assigned this May 29, 2018
@ovasquez ovasquez added this to the 0.7 milestone Jun 10, 2019
@ovasquez
Copy link
Owner

Sorry for the incredibly late reply.

Given that mkdocs-merge works independently of MkDocs (not as a plugin), I’m not sure it can be done 100% agnostic of where the files will be used because the directory nesting will change.

Having a CLI option to enable link overwrite seems like a good middle ground. I’ll try to come up with several directory scenarios to provide good coverage for this.

@ovasquez ovasquez modified the milestones: 0.7, 0.9 Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants