Created
May 14, 2016 11:42
-
-
Save orbitbot/6baa0b9591b0065859c53168a5ba63ce to your computer and use it in GitHub Desktop.
GH Pages SPA hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.backalleycoder.com/2016/05/13/sghpa-the-single-page-app-hack-for-github-pages/ | |
<script> | |
sessionStorage.redirect = location.href; | |
</script> | |
<meta http-equiv="refresh" content="0;URL='http://MY_PROJECT_HERE.github.io'"></meta> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- approach from http://www.backalleycoder.com/2016/05/13/sghpa-the-single-page-app-hack-for-github-pages/ --> | |
<script> | |
(function(){ | |
var redirect = sessionStorage.redirect; | |
delete sessionStorage.redirect; | |
if (redirect && redirect != location.href) { | |
history.replaceState(null, null, redirect); | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment