forked from biojava/biojava.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
35 lines (35 loc) · 818 Bytes
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
layout: page
permalink: /404.html
title: 404 Page Not Found
---
<script>
var allposts = [];
function redirectToCorrectPage() {
{% for post in site.pages %}
allposts.push("{{ post.url }}");
{% endfor %}
{% for post in site.wiki %}
allposts.push("{{ post.url }}");
{% endfor %}
var url = window.location.pathname;
// strip trailing /
if (url.slice(-1) === "/") {
url = url.slice(0, -1);
}
var allpostsUpperCase = allposts.map(function(value) {
// strip trailing /
if (value.slice(-1) === "/") {
value = value.slice(0, -1);
}
return value.toUpperCase();
});
var i = allpostsUpperCase.indexOf(url.toUpperCase());
if (i != -1) {
console.log(allposts[i]);
window.location = allposts[i];
}
}
window.onload = redirectToCorrectPage;
</script>
<p>Sorry this page does not exist =(</p>