Skip to content

Commit 2ecbd79

Browse files
committed
Updates
1 parent 19f3553 commit 2ecbd79

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

404.html

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,31 @@
44
<meta charset="utf-8">
55
<title>Redirecting...</title>
66
<script type="text/javascript">
7-
// Redirect to the root of the application
8-
// The React app's BrowserRouter will then handle the path
9-
window.location.replace('/');
7+
// Single Page Apps for GitHub Pages
8+
// MIT License
9+
// https://github.com/rafgraph/spa-github-pages
10+
// This script takes the current URL and converts the path and query
11+
// string into just a query string, and then redirects the browser
12+
// to the new URL with the query string and hash fragment, but no
13+
// path, to load the single page app's index.html root.
14+
(function(){
15+
var path = window.location.pathname;
16+
var query = window.location.search;
17+
var fragment = window.location.hash;
18+
19+
// Only redirect if not already on index.html and not a direct file request
20+
if (path !== '/index.html' && !path.endsWith('.html')) {
21+
// Store the original path in sessionStorage
22+
sessionStorage.setItem('redirectPath', path + query + fragment);
23+
// Redirect to index.html
24+
window.location.replace('/index.html');
25+
} else if (sessionStorage.getItem('redirectPath')) {
26+
// If we are on index.html and there's a stored redirectPath,
27+
// then replace the current history state with the stored path
28+
window.history.replaceState(null, null, sessionStorage.getItem('redirectPath'));
29+
sessionStorage.removeItem('redirectPath');
30+
}
31+
})();
1032
</script>
1133
</head>
1234
<body>

asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.8cf62888.css",
4-
"main.js": "/static/js/main.1f1a6b82.js",
4+
"main.js": "/static/js/main.2f60572d.js",
55
"static/js/453.33f95396.chunk.js": "/static/js/453.33f95396.chunk.js",
66
"index.html": "/index.html",
77
"main.8cf62888.css.map": "/static/css/main.8cf62888.css.map",
8-
"main.1f1a6b82.js.map": "/static/js/main.1f1a6b82.js.map",
8+
"main.2f60572d.js.map": "/static/js/main.2f60572d.js.map",
99
"453.33f95396.chunk.js.map": "/static/js/453.33f95396.chunk.js.map"
1010
},
1111
"entrypoints": [
1212
"static/css/main.8cf62888.css",
13-
"static/js/main.1f1a6b82.js"
13+
"static/js/main.2f60572d.js"
1414
]
1515
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en" class="dark"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><link rel="icon" type="image/svg+xml" href="/favicon.svg"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="codex by fezcode..."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet"><title>fezcodex</title><script defer="defer" src="/static/js/main.1f1a6b82.js"></script><link href="/static/css/main.8cf62888.css" rel="stylesheet"></head><body class="bg-gray-950"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en" class="dark"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><link rel="icon" type="image/svg+xml" href="/favicon.svg"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="codex by fezcode..."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet"><title>fezcodex</title><script defer="defer" src="/static/js/main.2f60572d.js"></script><link href="/static/css/main.8cf62888.css" rel="stylesheet"></head><body class="bg-gray-950"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)