Skip to content

Commit

Permalink
Simple redirect solution with custom 404.html (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanpince authored Apr 12, 2024
1 parent 84c84d4 commit bcd1c49
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:

- name: Touch CNAME
run: echo "docs-v2.sequence.xyz" > ./docs/dist/CNAME

- name: Copy 404
run: cp 404.html ./docs/dist/404.html

- name: Push
uses: s0/git-publish-subdir-action@develop
Expand Down
41 changes: 41 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<title>404 Page Not Found</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
}
h1 {
font-size: 36px;
margin-bottom: 20px;
}
p {
font-size: 18px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<h1>Page Not Found</h1>
<p>The page you are looking for could not be found, <a href="/">you check the docs index here</a>.</p>
<script>
// Define the list of old paths and target paths
var paths = [
{ oldPath: '/waas/intro/', targetPath: '/solutions/wallets/embedded-wallet/overview/' },

];

var currentPath = window.location.pathname;

for (var i = 0; i < paths.length; i++) {
if (paths[i].oldPath === currentPath) {
window.location.href = paths[i].targetPath;
break;
}
}
</script>
</body>
</html>

0 comments on commit bcd1c49

Please sign in to comment.