Skip to content

Commit b28084c

Browse files
committed
docs: redirect missing pages to their current page or the main page
1 parent 5cdac0c commit b28084c

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

‎404.html‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Page not found - osw-python</title>
6+
<meta name="robots" content="noindex">
7+
<noscript>
8+
<meta http-equiv="refresh" content="0; url=/osw-python/">
9+
</noscript>
10+
<script>
11+
// GitHub Pages serves this file for every missing path. Paths of the
12+
// documentation before mike go to their current page, every other
13+
// missing path goes to the main page.
14+
(function () {
15+
var base = "/osw-python/";
16+
var moved = {
17+
tools: "latest/tools/",
18+
osw: "latest/api/core/",
19+
controller: "latest/api/controller/",
20+
model: "latest/api/model/",
21+
auth: "latest/api/auth/",
22+
license: "latest/about/",
23+
authors: "latest/about/"
24+
};
25+
var path = window.location.pathname;
26+
var rest = path.indexOf(base) === 0 ? path.slice(base.length) : "";
27+
var first = rest.split("/")[0];
28+
var target = Object.prototype.hasOwnProperty.call(moved, first)
29+
? moved[first]
30+
: "";
31+
window.location.replace(base + target);
32+
})();
33+
</script>
34+
</head>
35+
<body>
36+
<p>
37+
This page does not exist. Go to the
38+
<a href="/osw-python/">osw-python documentation</a>.
39+
</p>
40+
</body>
41+
</html>

0 commit comments

Comments
 (0)