(see also PR #50)
I would like to use mkdocs-redirects in our effort to port our documentation from Sphinx/.rst (hosted at ReadTheDocs to MkDocs/.md (hosted at GitHub Pages), so we can avoid breaking our current documentation URLs.
This is actually working already, by using something like:
plugins:
- redirects:
redirect_maps:
en/latest/example.html: example.md
This makes a URL like https://example.github.io/docs/en/latest/exampe.html redirect correctly to https://example.github.io/docs/example/.
The problem is that mkdocs-redirects currently logs a warning for redirects of non-MarkDown paths:
WARNING - redirects plugin: 'en/latest/example.html' is not a valid markdown file!
That's annoying, since we would like to use mkdocs build --strict in CI to test changes to our documentation, and that exits with a non-zero exit code as soon there as any warnings.
Two potential ways forward:
(see also PR #50)
I would like to use
mkdocs-redirectsin our effort to port our documentation from Sphinx/.rst(hosted atReadTheDocsto MkDocs/.md(hosted at GitHub Pages), so we can avoid breaking our current documentation URLs.This is actually working already, by using something like:
This makes a URL like
https://example.github.io/docs/en/latest/exampe.htmlredirect correctly tohttps://example.github.io/docs/example/.The problem is that
mkdocs-redirectscurrently logs a warning for redirects of non-MarkDown paths:That's annoying, since we would like to use
mkdocs build --strictin CI to test changes to our documentation, and that exits with a non-zero exit code as soon there as any warnings.Two potential ways forward:
.htmlpaths (since it works fine);.htmlpaths, through a configuration option likeallow_html_redirect(implemented in add 'allow_html_redirect' configuration option to avoid printing warning when redirecting .html URLs #50);