Closed prcr closed 3 years ago
@burkestar, perhaps you'll get a chance to review this fix soon? In the meantime, I updated the CHANGES.md and the README.md (as it was still mentioning absolute paths).
Released to PyPi as 1.0.3
Some day I'll get around to updating this package with better standards (PR tests, drop python 2 support, and auto-releasing logic on merge).
Many thanks for such a quick reply!
Yes, those things would come in handy before considering introducing more features (for example, this one https://github.com/datarobot/mkdocs-redirects/issues/16#issue-663705242 would be helpful for me as well).
But as it is, the plugin is already incredibly useful - I'm maintaining a medium/large documentation site and the redirects are crucial to avoid having broken links on the product UI. This plugin allows me to manage the redirects in a simple and sane way. :smile: :+1:
That's really cool to hear @prcr! I built this for an internal developer docs site awhile ago and was like "you know, I bet others would find this useful". The power of open source. Thanks for your contributions to making this better.
While deploying version 1.0.2 of the plugin that includes the changes from https://github.com/datarobot/mkdocs-redirects/pull/19 I noticed that in some situations the build of the site would fail:
I found out that this would happen if:
use_directory_urls: true
index.md
orREADME.md
In this particular situation, after removing the
index.html
from the target path we would obtain an empty string and the call toos.path.relpath
would subsequently fail:https://github.com/datarobot/mkdocs-redirects/blob/b0d564bdc7f2364e4fec0cec6dcf4dc23ca8ea0f/mkdocs_redirects/plugin.py#L56-L60
My fix ensures that in this case the returned string is
./
so thatos.path.relpath
can correctly calculate the relative path.