mkdocs / mkdocs-redirects

Open source plugin for Mkdocs page redirects
MIT License
177 stars 26 forks source link

Redirect does not work on Windows #5

Closed diba1013 closed 4 years ago

diba1013 commented 4 years ago

I am currently writing and moving files for the documentation of https://docs.retest.de. Thus I find your plugin very helpful to specify the redirect to the new pages.

However, with following configuration, I get an error under Windows (full setup):

plugins:
  - search
  - redirects:
      redirect_maps:
        "recheck/how-ignore-works-in-recheck.md": "recheck/how-ignore-works.md"
WARNING -  Redirect target 'recheck/how-ignore-works.md' does not exist! 

As so often, a change to the os dependent path separator does the trick. I just needed to adjust the new page with the separators. The old does work with both.

"recheck/how-ignore-works-in-recheck.md": "recheck\\how-ignore-works.md"

However, we deploy our site to github pages. Thus we need the linux separators, while still being able to serve the site locally while expanding the documentation and testing if the redirect works properly. While one can use WSL, it would be more comfortable if it works on both systems.

To verify the problem is properly solved for linux, I switched to WSL (Debian). I was able to properly serve this page and follow the redirect (see retest/docs#47).

Setup

Full setup available here.

Tested on following operating systems:

MkDocs:

Unfortunately I do not have the time to do a proper PR, thus only this issue.

XhmikosR commented 4 years ago

@zhimsel I also see this on my Windows VM but indeed it works fine on nix

dschaper commented 4 years ago

I think I can fix this but a better implementation would require py3.4+.

zhimsel commented 4 years ago

I no longer work for DataRobot, and do not have any power over this repo :(

dschaper commented 4 years ago

Ah, okay. I'm happy to fork it but I don't know the ins/outs of the namespace or potential issues?

zhimsel commented 4 years ago

Definitely feel free to fork it. I don't know if anyone over at DataRobot is going to be maintaining this or paying attention to the repo. I would recommend talking to the maintainer of mkdocs and having his docs/plugin list change to point to your fork.

I don't really use mkdocs any more (it was used in DataRobot, I don't use it personally), but I'd be happy to contribute in terms of code reviews if you take over this project (since I'm pretty familiar with the code).

dschaper commented 4 years ago

Thanks! I've forked to https://github.com/pi-hole/mkdocs-redirects-redux. We have pypi namespace already, I'll put things there. Happy to have you over on that repo!

diba1013 commented 4 years ago

@dschaper Thanks for fixing this. Could you let me know when you have released the new version, so that we can switch to the active maintained redirects?

XhmikosR commented 4 years ago

I submitted #9 which does fix the issue for me, although it might not be the best solution.