Skip to content

Instantly share code, notes, and snippets.

@eyssette
Last active October 11, 2022 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyssette/825e6022836ac0b8321457516a1ef250 to your computer and use it in GitHub Desktop.
Save eyssette/825e6022836ac0b8321457516a1ef250 to your computer and use it in GitHub Desktop.
A bookmarklet to automatically go to a GitHub Pages site from a repository on Github.com
  1. Copy the code below:
javascript:var url = window.location.href; const regex =/.*\.com\/(.*?)\/(.*)/; ;window.location.href = url.replace(regex,%27https://$1.github.io/$2%27).replace(%27blob/main/%27,%27%27).replace(/\.md$/,%27%27);
  1. Create a new bookmark.
  2. Set the bookmarklet name and paste the above as the URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment