-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
52 lines (41 loc) · 1.38 KB
/
404.html
File metadata and controls
52 lines (41 loc) · 1.38 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
layout: default
---
<div class="sponsor sponsor-home">
<div class="sponsor-content-detail">
<div class="sponsor-content-detail-heading">Page_not_found</div>
<div class="sponsor-content-detail-workshop">
Oh no 🙀 the page canot be not found. Our smart robot 🤖 will try and find the best fit and redirect you to
it in a few seconds... if he can find anything.
</div>
</div>
</div>
<script type="text/javascript">
console.debug('Starting hunt for URLs');
function findPage() {
"use-strict";
const allpages = [];
{% for post in site.pages %}
allpages.push('{{ post.url }}');
{% endfor %}
let url = window.location.pathname;
if (url.slice(-1) === "/") {
url = url.slice(0, -1);
}
url = url.toUpperCase();
const normalisedPages = allpages.map((value) => {
if (value.slice(-1) === "/") {
value = value.slice(0, -1);
}
return value.toUpperCase();
});
const matchedPage = normalisedPages.indexOf(url);
if (matchedPage !== -1) {
console.debug(`Redirecting to ${allpages[matchedPage]}`);
window.location = allpages[matchedPage];
} else {
console.debug(`No match found for ${url}`);
}
}
findPage();
</script>