A Simple Node.js CLI Utility to create redirecting shortlinks on your own website.
Install using npm or yarn:
npm install -g shortlinker
yarn global add shortlinkerThen run it:
shortlinker https://github.com/flxwu/shortlinker GH-Link
will create a GH-Link.html file in your current directory that redirects to https://github.com/flxwu/shortlinker.
Use -D to specify the directory in which the redirect-file will be put into:
shortlinker https://github.com/flxwu/shortlinker GH-Link -D code/flxwu.github.io/links/
Given the website root is flxwu.github.io, I can now access the shortlink via flxwu.github.io/links/GH-Link.html.
Use -G to enable automatic version control commit and push:
shortlinker https://github.com/flxwu/shortlinker GH-Link -D code/flxwu.github.io/links/ -G
shortlinker now creates the same shortlink as above, but also commits the new file and pushes it to the remote repository.