zachhannum / mkdocs-autolinks-plugin

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

Links do not work when viewing pages in Github/Bitbucket/etc. #3

Open zachhannum opened 4 years ago

zachhannum commented 4 years ago

When viewing the source documentation, relative links do not work. This is expected behavior since the plugin only calculates the relative paths and modifies the markdown on the fly before being processed into HTML, but this of course means that when viewing the markdown in the source repository, links between pages do not work.

I'm not sure at the moment how to actually make this work.

oxr463 commented 4 years ago

If you input a relative URL, then it should still attempt to find it when generating the site. That way the links still work for both.

For example, in your mkdocs.yml:

plugins:
  - autolinks:
      override_relative: True

Then in doc/foo.md:

This is my link to [bar](../bar.md).

When override_relative is set, the plugin should first drop the path to the file, and then search for the file like it already does.