forked from hundredrabbits/Grimgrains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
42 lines (37 loc) · 1.36 KB
/
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
36
37
38
39
40
41
42
---
permalink: /404.html
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Grim Grains is an illustrated food blog, it features plant-based (vegan) recipes.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Redirect -->
<meta http-equiv = "refresh" content = "10; url=https://grimgrains.com/site/home.html" />
<link rel="stylesheet" type="text/css" href="https://grimgrains.com/links/main.css"/>
<title>GrimGrains</title>
</head>
<body>
<p>The page you were looking for does not exist, if you think this was a mistake, please report the broken link <a href='https://github.com/hundredrabbits/Grimgrains' target='_blank'>here</a>, or go back to the <a href='/site/home.html'>home</a>.</p>
<script>
'use strict'
const parts = window.location.pathname.split("/")
const target = parts.slice(-1)
const filename = toFilename(target[0])
const filepath = `https:/grimgrains.com/site/${filename}.html`
if(UrlExists(filepath)){
window.location.replace(filepath)
}
function UrlExists(url) {
const http = new XMLHttpRequest()
http.open('HEAD', url, false)
http.send()
return http.status!=404
}
function toFilename(str){
return `${str}`.replace('#','').replace(/[\W_]+/g,"_").toLowerCase().trim()
}
</script>
</body>
</html>