mkdocs / mkdocs-redirects

Open source plugin for Mkdocs page redirects
MIT License
176 stars 25 forks source link

Use relative paths for redirects #19

Closed plannigan closed 3 years ago

plannigan commented 3 years ago

Changes the path assigned to location.href to be relative to old html page.

The PR adds pytest test cases to verify the produced paths.

You can also see the output in action. These are the configured redirects.

Using relative paths: Fixes #17 (Local file redirects) Fixes jimporter/mike#35 (Site hosted in a sub-directory without depending on a static site_url from the mkdocs config)

plannigan commented 3 years ago

@burkestar @zhimsel Would it be possible to get a review of these changes?

zhimsel commented 3 years ago

I no longer have write access to the repo as I no longer work at DataRobot.

prcr commented 3 years ago

@burkestar, how can we work to have these changes merged into the original project?

burkestar commented 3 years ago

Thanks @plannigan for the contribution here, and @prcr for the reminder.

I'll get this released to PyPI today. Needs a changelog update and possibly a few other tweaks to get it ready. Sorry for the long delay!

burkestar commented 3 years ago

Released as 1.0.2

prcr commented 3 years ago

Thanks for the quick reply @burkestar! :+1:

I began doing a full rollout of the new version of the plugin to production but came across an issue in the specific scenario of having a redirect target index.md (as I'm doing to redirect a few deleted pages to the documentation homepage). I proposed a simple fix on https://github.com/datarobot/mkdocs-redirects/pull/21.