@fjell/registry
Version:
Dependency injection and service location system for the Fjell ecosystem
54 lines (48 loc) • 2.08 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fjell Registry Documentation</title>
<meta name="description" content="Redirecting to documentation...">
<script>
// GitHub Pages SPA routing fix
// This script redirects 404 errors back to the main app with the path preserved in the hash
(function () {
var redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect !== location.href) {
// Extract the path from the redirect URL
var path = redirect.split('/registry/')[1] || '';
// If there's a path, set it as the hash for the SPA to handle
if (path) {
// Convert path segments to hash-based routing
// e.g., /registry/client-api/operations -> #client-api/operations
var hashPath = path.replace(/^\/+|\/+$/g, ''); // Remove leading/trailing slashes
location.replace(location.protocol + '//' + location.host + '/registry/#' + hashPath);
} else {
// No specific path, go to root
location.replace(location.protocol + '//' + location.host + '/registry/');
}
} else {
// Check if current URL has path segments that should be converted to hash
var segments = location.pathname.split('/registry/')[1];
if (segments && segments !== '' && segments !== 'index.html') {
var hashPath = segments.replace(/^\/+|\/+$/g, '');
location.replace(location.protocol + '//' + location.host + '/registry/#' + hashPath);
} else {
// Default redirect to main app
location.replace(location.protocol + '//' + location.host + '/registry/');
}
}
})();
</script>
</head>
<body>
<div
style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; text-align: center; padding: 50px;">
<h1>Redirecting...</h1>
<p>Taking you to the Fjell Registry documentation.</p>
<p>If you're not redirected automatically, <a href="/registry/">click here</a>.</p>
</div>
</body>
</html>