Skip to content

Commit

Permalink
handla SPA routing for gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
suejinkim20 committed Jul 12, 2024
1 parent 295da29 commit d97ab8e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />

<title>FABRIC KNIT Workshop 404</title>

<script>
sessionStorage.redirect = location.href;
</script>

<meta http-equiv="refresh" content="0;URL='/knit-website'"></meta>
</head>

<body>
<!-- The purpose of this file is only for deployment at gh pages. -->

</body>


</html>
13 changes: 12 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
<title>FABRIC KNIT Workshop</title>
</head>
<body>
<!-- The purpose of this script is only for deployment at gh pages. -->

<script>
(function(){
var redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect != location.href) {
history.replaceState(null, null, redirect);
}
})();
</script>
<div id="root"></div>
</body>
</html>
</html>

0 comments on commit d97ab8e

Please sign in to comment.