https://github.com/scriptex/url-shortener
My personal URL shortener
https://github.com/scriptex/url-shortener
redirect url-shortener
Last synced: 5 months ago
JSON representation
My personal URL shortener
- Host: GitHub
- URL: https://github.com/scriptex/url-shortener
- Owner: scriptex
- License: mit
- Created: 2020-11-26T21:17:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-06T07:13:30.000Z (7 months ago)
- Last Synced: 2025-07-06T08:28:12.375Z (7 months ago)
- Topics: redirect, url-shortener
- Language: Nunjucks
- Homepage: https://atanas.info/portfolio/open-source/url-shortener
- Size: 460 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/scriptex/url-shortener/actions?query=workflow%3ABuild)
[](https://www.codacy.com/gh/scriptex/url-shortener/dashboard?utm_source=github.com&utm_medium=referral&utm_content=scriptex/url-shortener&utm_campaign=Badge_Grade)
[](https://codebeat.co/projects/github-com-scriptex-url-shortener-master)
[](https://www.codefactor.io/repository/github/scriptex/url-shortener)
[](https://deepscan.io/dashboard#view=project&tid=3574&pid=5257&bid=40799)
[](https://github.com/scriptex/url-shortener/)
# Personal URL shortener
## Visitor stats




## Code stats





## Manage Links
Links are managed through [`src/links.json`](src/links.json), which is seeded
with a few examples to start:
```json
{
"/": "https://atanas.info",
"in": "https://linkedin.com/in/scriptex",
"tw": "https://twitter.com/scriptexbg"
}
```
It couldn't be simpler: the key is the "shortlink" path that gets redirected,
and the value is the target URL. Keys can be as short or as long as you want,
using whatever mixture of characters you want. `/` is a special entry for
redirecting the root path.
Go ahead and make an edit, then commit and push to your repository. The hosting
provider you chose above should automatically build and deploy your change.
That's it!
### Config
Environment variables are used to set config options. There is only one at this
point:
| Variable | Description | Values | Default |
| -------- | ------------------------------------------------------------------ | -------- | ------- |
| `USE_JS` | Whether to redirect with JavaScript instead of a `` refresh. | `1`, `0` | `0` |
### Install Manually
To install somewhere else, or just on your own machine:
1. Fork this repository to create your own copy and clone to your machine.
2. Make sure you have a compatible version of [Node.js](https://nodejs.org/)
(see `engines.node` in [`package.json`](package.json)).
[nvm](https://github.com/nvm-sh/nvm) is the recommended installation method
on your own machine:
```bash
$ nvm install
```
3. Install dependencies with npm:
```bash
$ npm install
```
4. Build the static site:
```bash
$ npm run build
```
5. Deploy the generated `_site` directory to its final destination.
## Development
The following includes a few instructions for developing. For 11ty-specific
details – the static site generator that powers the url shortener – see their
[docs](https://www.11ty.dev/docs/).
### Install
Follow the "Install Manually" section above to setup on your own machine.
### Start
Start the development server:
```bash
$ npm run dev
```
### Code Style
[Prettier](https://prettier.com/) is setup to enforce a consistent code style.
It's highly recommended to
[add an integration to your editor](https://prettier.io/docs/en/editors.html)
that automatically formats on save.
To run via the command line:
```bash
$ npm run lint
```
## Releasing
After development is done in the `development` branch and is ready for release,
it should be merged into the `master` branch, where the latest release code
lives. [Release It!](https://github.com/release-it/release-it) is then used to
interactively orchestrate the release process:
```bash
$ npm run release
```
---
Connect with me:
---