zachhannum / mkdocs-autolinks-plugin

An MkDocs plugin that automagically generates relative links between markdown pages
https://pypi.org/project/mkdocs-autolinks-plugin/
MIT License
80 stars 31 forks source link

Incorrect links between pages that are more than two levels deep #6

Closed DominikaK closed 3 years ago

DominikaK commented 4 years ago

First things first, thank you for the very useful plugin.

I've encountered one issue: links are generated incorrectly between pages that are more than two levels deep.

For example, see part of my mkdocs.yml file:

nav:
    - Animals:
        - Mammals:
            - Cats:
                - 'test/mammals/cats/cat.md'
            - Dogs:
                - 'test/mammals/dogs/dog.md'
        - Reptiles:
            - Lizards:
                - 'test/reptiles/lizards/lizard.md'

A link is generated correctly between pages cat.md and dog.md.

However, when cat.md contains the following link:

[Lizard](lizard.md)

the generated link looks like this:

http://<my_domain>/test/mammals/cats/cat/..../reptiles/lizards/lizard.md

and the link does not work.