https://github.com/paramt/go.param.me
Private URL shortener for my personal links
https://github.com/paramt/go.param.me
url-shortener
Last synced: about 1 year ago
JSON representation
Private URL shortener for my personal links
- Host: GitHub
- URL: https://github.com/paramt/go.param.me
- Owner: paramt
- License: mit
- Created: 2019-11-22T01:50:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T23:29:28.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T14:55:42.292Z (about 1 year ago)
- Topics: url-shortener
- Language: Python
- Homepage: https://go.param.me/source
- Size: 77.1 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go.param.me [](https://app.netlify.com/sites/go-param-me/deploys)
> A URL shortener for my personal links.
## Redirects
All the redirect URLs are maintained in [`redirects.csv`](redirects.csv), which is fetched by the client [`script.js`](script.js) each time someone visits the site. There is no dynamic content as everything is done by the client-side. Alternatively, and if Netlify is set up, then a `_redirects` file can be used to create server-side redirects which improve SEO and are faster.
> Note: server-side redirects only support `http` and `https` protocols. `mailto` links will fallback on `redirects.csv`
## Usage
Redirects can be added or removed by opening a new issue on GitHub. Creating a new issue runs [`update_redirects.py`](update_redirects.py), which modifies `redirects.csv` and `_redirects`.
### Add URL
In order to add a redirect, the issue must be created by the user specified in `config.js`, be titled "Add URL", and have the update redirects label. The issue body needs to follow this syntax:
```
Short URL --> Long URL
```
### Remove URL
In order to remove a redirect, the issue must be created by the user specified in `config.js`, 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`](config.js), the meta redirect in [`index.html`](https://github.com/paramt/go.param.me/blob/master/index.html#L6), and the domain name in [`CNAME`](CNAME). Remember to delete the existing redirects too!
### `config.js`
| Option | Description | Type | Example |
| --- | --- | --- | --- |
| `shortDomain` | The short domain that will redirect to other URLs | `str` | `"go.param.me"` |
| `defaultRedirect` | The default redirect in case a link that does not exist is requested | `str` | `"https://www.param.me"` |
| `repo` | The GitHub repo where `redirects.csv` is located | `str` | `"paramt/go.param.me"` |
| `users` | The list of GitHub users that are allowed to modify the list of redirects by opening an issue | `str[]` | `["paramt"]` |
| `netlify_redirects` | Whether or not the script should generate a `_redirects` file (used by Netlify's server-side redirects) | `bool` | `true` |
| `utm` | Whether or not a UTM code should be appended to the URL when redirecting. *Note: this does not work if server-side redirects are being used*| `bool` | `false` |
## License
The repo is licensed under the [MIT License](LICENSE), so you may use and modify the code in any way as long as the copyright and license notices are kept.