-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
30 lines (27 loc) · 1.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Not Found</title>
<noscript>JavaScript is required to load this page.</noscript>
</head>
<body>
<h1>404 - Page Not Found</h1>
<script>
(async () => {
const response = await fetch('./entry-point.json');
const { isGithubCodespaces, GITHUB_REPOSITORY_NO_USER } = await response.json();
const anchor = document.createElement('a');
const header = document.querySelector('h1');
const script = document.querySelector('script');
if (!anchor || !header || !script) return;
const href = isGithubCodespaces ? '/' : `/${GITHUB_REPOSITORY_NO_USER}`;
anchor.setAttribute('href', href)
anchor.innerHTML = 'Go Back Home';
header.insertAdjacentElement('afterend', anchor);
script.remove();
})()
</script>
</body>
</html>