-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 in pages below the top-level document folder point to the wrong path #292
Comments
Probably same as #77 but this is more helpful. |
I wasn't sure if #77 was the exact same issue. Thanks for referencing it. |
This is a great report, thanks very much. Things gets a bit confusing as, I think, we have links in three different scenarios.
The first two vary because we move the location of markdown files ( @jdhoek Just to check, did you test this against the latest release or via git master? There was some fairly recent fixes for images, but I can't remember if it made the last release or not :) |
... I just confirmed, it is still an issue with the latest dev version. |
I can't see an obvious reason, but the broken image path is coming out as |
Gah, I see the issue with images. It comes down to my miss-understanding of the url rewriting when I added support for them. it is actually a coincidence that any of these work. 😳 Clearly the tests I added for this are completely bogus. I'll look into a real fix. Using |
@d0ugal |
I came across this problem today, any eta on v0.12 ? :-) Currently I have to choose between working images in the GitHub repo or on the generated site :-) |
… website, fixed in mkdocs v0.12 see : mkdocs/mkdocs#292
@Mopster The 0.12.0 milestone is here. I've got it down to just a smallish number of bugs. https://github.com/mkdocs/mkdocs/milestones/0.12.0 - I am hoping to do it this weekend, but no guarantees ;) |
great! gonna show it off to the office today ;-) |
I also have these issues been trying loads of different ways to get images to show up on GitHub, with no luck. They work on a website domain and also in MKdocs server too just no luck at all in Github. Can anyone help me with this or is it not possible? |
I was able to get this working by using a relative path. Eg in ![Screenshot](../../img/image.jpg) Obviously not ideal cause each time one needs to remember the file location relative to the |
I have the same issue, the solution is clear... just change the path. BUT ! the relative paths markdown -> assets (./xy) is rendered correctly by almost every platform (github, gitea, vscode etc.) once you copy a document structure to mkdocs, we have to change all paths basically to correct into "wrong" to the other platforms. this quite sucks since the assets relative path is current to the markdown BUT incorrect after build. mkdocs needs a assets-uri-resolver strategy configuration. |
Does this answer on SO fix your problem ? |
Relative image links in pages below the top-level document folder seem to point to the wrong path.
Reproduction
I've created a minimal reproduction case:
https://github.com/jdhoek/mkdocs-test-relative-image-links
The reproduction case contains this file structure:
mkdocs serve
andmkdocs build
correctly process the Markdown files in the top-level folderdocs_dir
, but with the Markdown file in the sub-folder the relative image links are broken.The text was updated successfully, but these errors were encountered: