Last active
September 6, 2020 00:43
-
-
Save michaelrhodes/d7e2a47879b7ba1e717d to your computer and use it in GitHub Desktop.
A bookmarklet for toggling between github repositories and their github pages.
This file contains 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
javascript:(function(){(function(){if(/github.io$/.test(location.host)){var%20paths=location.href.match(/^.+\/\/(.+)\.github\.io\/([^\/]+)?\/?.*$/).slice(1);location.href="https://github.com/"+paths[0]+"/"+(paths[1]||'')}else%20if(location.host=="github.com"){var%20paths=location.pathname.substr(1).split("/");location.href="http://"+paths[0]+".github.io/"+paths[1]}})()})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/aeosynth/bookmarklets/blob/master/github.js goes both ways