Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects to README.md (as index.html) are broken since v1.0.2 #23

Closed
oprypin opened this issue Aug 1, 2021 · 3 comments · Fixed by #25
Closed

Redirects to README.md (as index.html) are broken since v1.0.2 #23

oprypin opened this issue Aug 1, 2021 · 3 comments · Fixed by #25

Comments

@oprypin
Copy link
Contributor

oprypin commented Aug 1, 2021

cat >mkdocs.yml
site_name: test
use_directory_urls: false

theme:
  name: material

plugins:
  - redirects:
      redirect_maps:
        foo.md: foo/README.md
mkdir -p docs/foo
touch docs/foo/README.md
pip install -U mkdocs-redirects==1.0.2
mkdocs build
cat site/foo.html                        
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Redirecting...</title>
    <link rel="canonical" href="foo/README.html">
    <meta name="robots" content="noindex">
    <script>var anchor=window.location.hash.substr(1);location.href="foo/README.html"+(anchor?"#"+anchor:"")</script>
    <meta http-equiv="refresh" content="0; url=foo/README.html">
</head>
<body>
Redirecting...
</body>
</html>

In the above example you can see a problem: MkDocs doesn't produce a file "README.html"; instead it is "index.html", so the redirect is broken.
Previously it worked well:

pip install -U mkdocs-redirects==1.0.1
mkdocs build
cat site/foo.html                        
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Redirecting...</title>
    <link rel="canonical" href="/foo/index.html">
    <meta name="robots" content="noindex">
    <script>var anchor=window.location.hash.substr(1);location.href="/foo/index.html"+(anchor?"#"+anchor:"")</script>
    <meta http-equiv="refresh" content="0; url=/foo/index.html">
</head>
<body>
Redirecting...
</body>
</html>

I believe this is a direct consequence of #19 (cc @plannigan).

#21 has no effect on it; v1.0.3 is still broken.

oprypin added a commit to oprypin/crystal-book that referenced this issue Aug 1, 2021
Due to a bug, redirects to "README.md" are no longer recognized correctly as "index.html":
mkdocs/mkdocs-redirects#23
oprypin added a commit to crystal-lang/crystal-book that referenced this issue Aug 1, 2021
Due to a bug, redirects to "README.md" are no longer recognized correctly as "index.html":
mkdocs/mkdocs-redirects#23
@oprypin
Copy link
Contributor Author

oprypin commented Dec 14, 2021

This is still a really big issue.

@plannigan @burkestar Do you have any plans to continue maintenance of this package (i.e. merging the pending fixes and releasing them)? If not, would you be open to handing over maintenance?
I'm the current maintainer of MkDocs itself, and I offer to maintain this package, including moving it to mkdocs organization if necessary.

@plannigan
Copy link
Contributor

While I did contribute the code for the initial change (and a PR that should address this issue), I don't have write access on the repository. So I can't merge any PRs or release new versions of the library.

It does seem like a fork might be in order because the repository doesn't appear to be actively maintained. It took 4 months to get the initial change merged & a similar thing happening with this issue. @burkestar Would DataRobot be open to transferring ownership to the maintainers of MkDocs?

@oprypin
Copy link
Contributor Author

oprypin commented Dec 14, 2021

Oops I considered so many times that I need to double-check who I'm @-ing but made the embarrassing mistake anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants