Skip to content

FIX: improve redirect page #57

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
FIX: improve redirect page
  • Loading branch information
jklymak committed Feb 27, 2021
commit c74ee58e6351bb192b9d8f4ce90e4649d500c476
42 changes: 30 additions & 12 deletions _websiteutils/make_redirects_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

toignore = tocheck + [pathlib.Path(p) for p in [
"mpl-probscale",
"mpl_examples",
"mpl_toolkits",
"_webpageutils",
"xkcd",
"_sitemap",
Expand All @@ -67,18 +65,38 @@ def findlast(fname, tocheck):
return None


html_redirect = """<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0;url={newurl}" />
<link rel="canonical" href="https://matplotlib.org/{canonical}" />
</head>
<body>
html_redirect = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Comment on lines +70 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use html5 doctype, no need for xhtml at this point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats just from the top of matplotlib.org?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Matplotlib: Python plotting &#8212; Page Moved</title>
<link rel="stylesheet" href="_static/mpl.css" type="text/css" />
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9,
maximum-scale=0.9" />
<meta http-equiv="refresh" content="0;url={newurl}" />
<link rel="canonical" href="https://matplotlib.org/{canonical}" />
</head>
<body>
<div style="background-color: white; text-align: left;
padding: 10px 10px 15px 15px; position: relative;">
<a href="#">
<img src="_static/logo2_compressed.svg" height="125px" border="0"
alt="matplotlib"/>
</a>
<div class="body" role="main">
<div class="section">
<h1>
The page been moved <a href="{newurl}">here</a>!
This page been moved <a href="{newurl}">here</a>!
</h1>
</body>
</div>
</div>
</body>
</html>
"""

Expand Down