Link shortener for static sites built using GitHub Gist
- Create a gist on GitHub like this example
- Clone the repo into your static site directory
- Name the directory what you want to have in the path of your short URIs or setup up routing (eg. mine is named
l
so that I can send people to http://tomma.so/l#link) - Edit the app.js the app.js file
- Set gistID to the id of the gist (the last part of the URL when viewing the gist)
- Set defaultURL to the url you want to redirect people to when no link is specified
- Deploy your site
Add new links by editing your gist. Each link
is an object within the links
object. The key is the short text you want in the URI and the link object has one property which is the URI of the original link.
Once you've added a new link you can access it by navigating to /{directory-name}#{short-link-key}.
- Add admin interface
- Improve 404s
- Improve install process