Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,26 @@

<link rel="preconnect" href="https://api.github.com" />
<link rel="dns-prefetch" href="https://api.github.com" />

<!-- Single Page Apps for GitHub Pages: restore route after 404 redirect -->
<!-- https://github.com/rafgraph/spa-github-pages -->
<script>
(function(l) {
if (l.search[1] === '/') {
var decoded = l.search.slice(1).split('&').map(function(s) {
return s.replace(/~and~/g, '&');
});
window.history.replaceState(
null,
null,
l.pathname.slice(0, -1) +
decoded[0] +
(decoded[1] ? '?' + decoded[1] : '') +
l.hash
);
}
}(window.location));
</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton/src/social-share-button.css"
crossorigin="anonymous" />
<script defer src="https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton/src/social-share-button.js"
Expand Down
28 changes: 28 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>OrgExplorer</title>
<script>
// Single Page Apps for GitHub Pages
// https://github.com/rafgraph/spa-github-pages
//
// When GitHub Pages serves a 404 for any path that isn't a real file,
// this page intercepts the request, encodes the full URL as a query
// string parameter, and redirects back to the root index.html so that
// React Router can handle the route client-side.
var pathSegmentsToKeep = 0; // set to 1 if the app is served under a subpath (e.g. /repo-name/)

var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);
</script>
</head>
<body>
</body>
</html>
Loading