-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path404.html
32 lines (32 loc) · 3.95 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
<!DOCTYPE html><html lang=en><head><meta charset=UTF-8><title>phseiff - opinions & obscurities</title><meta name=description content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"><meta property=og:title content="phseiff - opinions & obscurities"><meta property=og:type content=website><meta property=og:image content=https://phseiff.com/images/icon.jpeg><meta property=og:url content=https://phseiff.com><meta property=og:description content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"><meta name=twitter:card content=summary><meta name=twitter:site content=@phseiff><meta name=twitter:creator content=@phseiff><meta name=twitter:image content=https://phseiff.com/images/icon.jpeg><meta name=twitter:title content="phseiff - opinions & obscurities"><meta name=twitter:description content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"><link rel=stylesheet href=/materialize-css/materialize.min.css media=screen,projection><link rel=stylesheet href=/google-fonts/icons.min.css><meta name=viewport content="width=device-width, initial-scale=1"><! color scheme ><meta name=apple-mobile-web-app-capable content=yes><meta name=theme-color content=orange><meta name=msapplication-navbutton-color content=orange><meta name=apple-mobile-web-app-status-bar-style content=orange><! Be an exception for darkreader ><meta name=darkreader content=104d4afa-2a17-4971-b5af-7914e4f49e72><body><span style="text-align: center;"> <style>.h2class{color:orange}</style> <a href=https://phseiff.com> <img src=/images/404.jpeg alt=404 title="visit phseiff.com!"class=circle style="width: 400px; height: 400px; display: block; margin: 0 auto; max-width: 80vw; max-height: 80vw;"> </a> <h4 class=h2class>Hm.... Looks like the <span id=page-or-essay>page</span> you wanted to access does not exist here.</h4> <h5>But you can visit <a href=https://phseiff.com>phseiff.com</a> for more opinions & obscurities! :)</h5> <script>
/* This is code to redirect from phseiff.com/e/foo to phseiff.com/#foo in case an essay exists, but is not
listed on the page and thus not accessible via /e/ in the URL. If the essay does not exist, but the URL
scheme is /e/ anyways, replace "page" in the "apology"-text with "essay".
*/
if (window.location.pathname.startsWith("/e/")) {
let essay_name = window.location.pathname.replace("/e/", "");
console.log("Essay name:", essay_name);
if (!essay_name.includes("/")) {
console.log("Essay requested!");
// Send request to determine whether page exists.
let request = new XMLHttpRequest();
request.open('GET', 'https://phseiff.com/phseiff-essays/' + essay_name + '.md', true);
request.onreadystatechange = function(){
if (request.readyState === 4){
if (request.status === 404) {
console.log("The essay does not exist!");
document.getElementById("page-or-essay").innerText = "essay";
}
else {
console.log("Redirecting!");
window.location.href = window.location.protocol + "//" + window.location.host + "/#" + essay_name;
}
}
};
request.send();
}
}
</script> <link rel=stylesheet href=/index.html.darkreader.min.css> </span>