Skip to content

Commit 78ff179

Browse files
committed
deploy: d14e5c0
1 parent 5f6a461 commit 78ff179

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

404.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>AI Smith Lab</title>
6+
<script>
7+
// Single Page App redirect for GitHub Pages
8+
// Converts the path into a query string so index.html can restore it
9+
var pathSegmentsToKeep = 0;
10+
var l = window.location;
11+
l.replace(
12+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
13+
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
14+
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
15+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
16+
l.hash
17+
);
18+
</script>
19+
</head>
20+
<body>
21+
</body>
22+
</html>

index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
</head>
2121

2222
<body>
23+
<!-- GitHub Pages SPA redirect: restores URL from 404.html query string -->
24+
<script>
25+
(function(l) {
26+
if (l.search[1] === '/') {
27+
var decoded = l.search.slice(1).split('&').map(function(s) {
28+
return s.replace(/~and~/g, '&')
29+
}).join('?');
30+
window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash);
31+
}
32+
}(window.location))
33+
</script>
2334
<div id="root"></div>
2435
</body>
2536
</html>

0 commit comments

Comments
 (0)