An MkDocs plugin

pip install mkdocs-autolinks-plugin==0.2.0


MkDocs Autolinks Plugin

An MkDocs plugin that simplifies relative linking between documents.

The Autolinks plugins allows you to link to pages and images within your MkDocs site without provided the entire relative path to the file in your document structure.


Install the plugin using pip:

pip install mkdocs-autolinks-plugin

Activate the plugin in mkdocs.yml:

  - search
  - autolinks 

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the [MkDocs documentation][mkdocs-plugins].


To use this plugin, simply create a link that only contains the filename of file you wish to link to.

For example, say you have a document structure like this:

├── guides/
│   ├──
│   └──
├── software/
│   ├──
│   └──
└── images/
    ├── avatar.png
    └── example.jpg

Normally, if you want create a link to from inside, you would need to provide the relative path:

[Git Flow](../software/

This link is fragile; if someone decides to rearrange the site structure, all of these relative links break. Not to mention having to figure out the relative path.

With the Autolinks plugin, you simply need to provide the filename you wish to link to. The plugin will pre-process all of your markdown files and replace the filename with the correct relative path, given that the file exists in your document structure:

[Git Flow](

The Autolinks plugin also works with jpg and png files: