Skip to content

Commit 8dc7d0b

Browse files
authored
Merge pull request #5 from bjoernQ/redirects
Have a redirector as 404.html to docs.espressif.com
2 parents b249605 + 6d66460 commit 8dc7d0b

File tree

3 files changed

+494
-44
lines changed

3 files changed

+494
-44
lines changed

404.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Page Moved</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<style>
8+
body {
9+
font-family: sans-serif;
10+
padding: 2rem;
11+
text-align: center;
12+
}
13+
</style>
14+
</head>
15+
<body>
16+
<h1>Page Moved</h1>
17+
<p>If you are not redirected automatically, <a id="manual-link" href="/index.html">click here</a>.</p>
18+
19+
<noscript>
20+
<p style="color: red;">
21+
JavaScript is required for automatic redirection. The page you're looking for has probably moved to:<br>
22+
<a href="https://docs.espressif.com/projects/rust/">https://docs.espressif.com/projects/rust/</a>
23+
</p>
24+
</noscript>
25+
26+
<script>
27+
(function () {
28+
const path = window.location.pathname;
29+
30+
if (path.startsWith("/esp-hal/esp-hal")) {
31+
window.location.href = "https://docs.espressif.com/projects/rust/esp-hal/latest/";
32+
} else if (path.startsWith("/esp-hal/esp-wifi")) {
33+
window.location.href = "https://docs.espressif.com/projects/rust/esp-wifi/latest/";
34+
} else if (path.startsWith("/book")) {
35+
const suffix = path.substring("/book/".length);
36+
window.location.href = "http://docs.espressif.com/projects/rust/book/" + suffix;
37+
} else if (path.startsWith("/no_std-training")) {
38+
const suffix = path.substring("/no_std-training/".length);
39+
window.location.href = "http://docs.espressif.com/projects/rust/no_std-training/" + suffix;
40+
} else {
41+
// Default fallback
42+
window.location.href = "/index.html";
43+
}
44+
})();
45+
</script>
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)