Hosted "Go-Links" via Git and GitHub Pages
pip install gitlinks
Jump to setup | By @logan_engstrom
gitlinks
is a command line tool that maps custom shortlinks to URLs via
Git and GitHub Pages .
The following table shows example mappings for user lengstrom
's gitlinks repository
goto:
Key | URL | GitHub Pages Shortlink |
---|---|---|
zoom |
https://mit.zoom.us/j/95091088705 | http://loganengstrom.com/goto/zoom |
classes/NLP |
https://canvas.mit.edu/courses/7503 | http://loganengstrom.com/goto/classes/nlp |
Here, anyone can access the
zoom
link (https://mit.zoom.us/j/95091088705) at
http://loganengstrom.com/goto/zoom
(since the GitHub pages site lengstrom.github.io
maps to loganengstrom.com
).
We can also organize keys through nesting, such as with classes/NLP
.
gitlinks
works by storing state on GitHub
and rendering structured redirects on GitHub pages. Add, remove, and visualize link mappings through the command line!
$ gitlinks set zoom https://mit.zoom.us/j/95091088705
=> Success: Set key "zoom" β "https://mit.zoom.us/j/95091088705".
$ gitlinks delete zoom
=> Success: Deleted key "zoom".
$ gitlinks show
=> Checking for changes from remote...
== GitLinks (Remote: [email protected]:lengstrom/goto.git) ==
calendly β https://calendly.com/loganengstrom
classes/18.102 β http://math.mit.edu/~rbm/18-102-S17/
classes/6.005 β http://web.mit.edu/6.031/www/fa18/general/
ffcv_slack β https://ffcv-workspace.slack.com/join/shared_invite/zt-11olgvyfl-dfFerPxlm6WtmlgdMuw_2A#/shared-invite/email
papers/bugsnotfeatures β https://arxiv.org/abs/1905.02175
zombocom β https://www.zombo.com
zoom β https://mit.zoom.us/j/95091088705
gitlinks
also generates an index page: see
http://loganengstrom.com/goto/ as an example. The big caveat of `gitlinks` is that all of your links are public to anyone on the web, so be careful with what you link!
Configure gitlinks
in two steps!
First, visit https://github.com/new and choose a short, memorable name like
go
for your gitlinks repository.
Now, check the box "Add a README file" (the repository can't be empty).
Make the repository, then go your repository's GitHub pages settings:
https://github.com/yourusername/repository_name/settings/pages
) and enable GitHub pages for the main
branch:
Install the gitlinks
executable via pip
: pip install gitlinks
. Then,
initialize gitlinks
to use your repository: gitlinks init remote_url
.
Your remote_url
can be found here:
After this step, you should be able to make go-links to your heart's content.
GPL v3