AnandChowdhary/anand.link
- January 5, 2020
- View on GitHub
- Python
- 3 stars
- 3 watchers
This repository automates a multi-domain URL shortener across all my sites. Currently running on:
- https://anand.link
- https://go.a11y.co
- https://redir.oswaldlabs.com
- https://sale.melangebox.com
- https://go.o15y.com
This repository is a fork of paramt/go.param.me and contains only data changes. If you want to star this project or submit a pull request, do it there instead.
All the redirect URLs are maintained in a single CSV file, which is fetched by the client-side JavaScript each time someone visits the site. There is no dynamic content as everything is done by the client-side.
💡 Usage
Redirects can be added, removed, or modified by updating redirects.csv. However, GitHub Actions makes it possible to automate this process. Creating a new issue triggers this worksflow which runs this Python script. The script is set up to automatically update redirects.csv based on the issue body.
Add URL
In order to add a redirect, the issue must be created by me, be titled “Add URL”, and have the update redirects label. The issue body needs to be:
Short URL —> Long URL
Remove URL
In order to remove a redirect, the issue must be created by me, be titled “Remove URL”, and have the update redirects label. The issue body should contain the short URL to remove.
Modify
If you’d like to create your own URL shortener, fork this repo, modify config.js, the meta redirect in index.html, and the domain name in CNAME.
📄 License
- MIT © Anand Chowdhary
- Original repo: paramt/go.param.me