feat(website): drop hash-based router
This commit is contained in:
34
packages/website/public/404.html
Normal file
34
packages/website/public/404.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Redirecting...</title>
|
||||
<script>
|
||||
// SPA fallback for GitHub Pages
|
||||
// Preserves the path so the SPA router can handle it after redirect
|
||||
var seg = 1 // number of path segments to keep (repo name = /page-agent)
|
||||
var loc = window.location
|
||||
loc.replace(
|
||||
loc.protocol +
|
||||
'//' +
|
||||
loc.hostname +
|
||||
(loc.port ? ':' + loc.port : '') +
|
||||
loc.pathname
|
||||
.split('/')
|
||||
.slice(0, 1 + seg)
|
||||
.join('/') +
|
||||
'/?p=' +
|
||||
encodeURIComponent(
|
||||
loc.pathname
|
||||
.slice(1)
|
||||
.split('/')
|
||||
.slice(seg)
|
||||
.join('/') +
|
||||
loc.search +
|
||||
loc.hash
|
||||
)
|
||||
)
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user