site_name: Dummy - Site
site_url: https://example.com/dummy
site_dir: public
nav:
- Index: index.md
- Foo: foo.md
Both markdown files contain the following:
# Lemming
![Lemming](img/lemming.jpg)
If I run mkdocs-linkchecker it finds one problem in file foo.md:
☠ mkdocs-linkcheck -l docs/
Total files checked: 2
Total links checked: 2
Local links: 2
Remote links: 0
Empty links: 0
Broken links: 1
Skipped links: 0
/tmp/dummy/docs/foo.md:
[✖] img/lemming.jpg
0.00154 seconds to check links
Bad links were found. Exiting with an error.
Please note it is happy about index.md even though it's the same file.
Also note that mkdocs serve is perfectly happy, and the site displays the image on both pages.
Now if I use ../img/lemming.jpg in foo.md instead:
# Lemming
![Lemming](../img/lemming.jpg)
Then, mkdocs-linkcheck is happy:
☠ mkdocs-linkcheck -l docs/
Total files checked: 2
Total links checked: 2
Local links: 2
Remote links: 0
Empty links: 0
Broken links: 0
Skipped links: 0
0.00129 seconds to check links
However, mkdocs serve isn't:
☠ mkdocs serve
INFO - Building documentation...
INFO - Cleaning site directory
WARNING - Documentation file 'foo.md' contains a link to '../img/lemming.jpg' which
is not found in the documentation files.
INFO - Documentation built in 0.06 seconds
INFO - [12:19:41] Watching paths for changes: 'docs', 'mkdocs.yml'
INFO - [12:19:41] Serving on http://127.0.0.1:8000/dummy/
Please note that both configurations work fine, both pages display the picture fine.
I have the following project:
Both markdown files contain the following:
If I run
mkdocs-linkchecker
it finds one problem in filefoo.md
:Please note it is happy about
index.md
even though it's the same file. Also note thatmkdocs serve
is perfectly happy, and the site displays the image on both pages.Now if I use
../img/lemming.jpg
infoo.md
instead:Then,
mkdocs-linkcheck
is happy:However,
mkdocs serve
isn't:Please note that both configurations work fine, both pages display the picture fine.