{"id":13832028,"url":"https://github.com/brunoluiz/urlzap","last_synced_at":"2026-03-11T12:23:02.483Z","repository":{"id":55590574,"uuid":"304450247","full_name":"brunoluiz/urlzap","owner":"brunoluiz","description":"⚡️ Your own static URL shortener","archived":false,"fork":false,"pushed_at":"2025-12-05T02:37:20.000Z","size":42,"stargazers_count":83,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-17T12:11:40.815Z","etag":null,"topics":["github-page","link-shortener","redirect-urls","redirects","self-hosted","shorten-urls","shortener","shortener-url","static-site","static-site-generator","static-website","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunoluiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-15T21:18:13.000Z","updated_at":"2025-11-28T17:07:15.000Z","dependencies_parsed_at":"2022-08-15T03:50:38.836Z","dependency_job_id":null,"html_url":"https://github.com/brunoluiz/urlzap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brunoluiz/urlzap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoluiz%2Furlzap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoluiz%2Furlzap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoluiz%2Furlzap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoluiz%2Furlzap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunoluiz","download_url":"https://codeload.github.com/brunoluiz/urlzap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoluiz%2Furlzap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30380940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-page","link-shortener","redirect-urls","redirects","self-hosted","shorten-urls","shortener","shortener-url","static-site","static-site-generator","static-website","url-shortener"],"created_at":"2024-08-04T10:01:48.363Z","updated_at":"2026-03-11T12:23:02.436Z","avatar_url":"https://github.com/brunoluiz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  URLZap\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Your own static URL shortener ⚡️\n\u003c/p\u003e\n\nStatic site generators, published on Github Pages, are quite popular nowadays. But what about a\nstatic URL shortener (to not say generator), which allows you to redirect URLs based on static files?\n\nUsually, developers end-up setting up a server with redirects for this (not statically). That is\nwhere URLZap comes in.  It generates URLs using files and HTML wizardry, allowing users to host\ntheir own URL redirects into Github Pages.\n\n- 🔗 Similar to static website generators, but for URLs\n- 🔒 Keep your (shortened or not) URLs with you\n- 🌎 Can be used with Github Pages\n- ☕️ No need to run a server or set-up HTTP 301 redirects\n\nExample project: [`brunoluiz/_`](https://github.com/brunoluiz/_)\n\n## ☕️ How does it work?\n\nYou might be asking yourself: how is this done without a server? Well, the answer lies on\n`\u003cmeta http-equiv=\"refresh\" /\u003e`. It works as HTTP 301 (Redirect) status code, but it is done\nin the client-side. [There is a bit more explanation on w3c website](https://www.w3.org/TR/WCAG20-TECHS/H76.html).\n\nBased on a `config.yml` containing the desired path and URL, `urlzap` will create `index.html`\nfiles which make use of meta refresh tags. It is not perfect as a HTTP 301, but is quite close.\nA similar strategy is used by other static website generators, such as Hugo.\n\nAn example would be:\n\n```yaml\npath: './links' # default is './'\nurls:\n  google: https://google.com\n  tools:\n    github: https://github.com\n```\n\nEach key in the map will map to `{.path param}/{key}` routes, redirecting to `{value}`.\nThis would generate the following:\n\n```\n- links/\n  - google/\n    - index.html (contains redirect)\n  - tools/\n    - github/\n      - index.html (contains redirect)\n```\n\nThese files can be uploaded to Github Pages for example, not requiring any server.  On\n[`brunoluiz/_`](https://github.com/brunoluiz/_) you can see an example `config.yml` and checkout\nthe output in `gh-pages` branch 😉\n\n## 📀 Install\n\n### Linux and Windows\n\n[Check the releases section](https://github.com/brunoluiz/urlzap/releases) for more information details\n\n### MacOS\n\nUse `brew` to install it\n\n```\nbrew tap brunoluiz/tap\nbrew install urlzap\n```\n\n## ⚙️ Usage\n\n### Generate files locally\n\nUsing the previous YAML example:\n\n```yaml\npath: './links' # default is './'\nurls:\n  google: https://google.com\n  tools:\n    github: https://github.com\n```\n\n- `urls`: desired URL map, following the `{key}:{redirect URL}` pattern\n- `path`: output path\n\nTo generate the static files, run `urlzap generate`.\n\n### Automatic deploy using Github Actions\n\nMost likely you will end-up using Github Pages together with this tool. If so, perhaps the best\nway to use it and reap its benefits is through Github Actions. Head to\n[`brunoluiz/urlzap-github-action`](https://github.com/marketplace/actions/urlzap) for more details\non how to install it, covering generation \u0026 deployment.\n\n\u003e ⚠️ You might need to manually enable Github Pages in your repository! More details at\n\u003e [Github Pages guide](https://pages.github.com/)\n\n### Manual deploy to Github Pages or similars\n\nIf Github Actions are not for you, try the following manual process instead.\n\n1. Enable Github Pages and set-up the branch where your static HTML files will be located.\nMore details at [Github Pages guide](https://pages.github.com/)\n1. Set-up your `config.yml`\n1. Commit and push to `main`\n1. Checkout to your Github Pages branch (usually `gh-pages`) and run `git reset --hard origin/main`\n(this will reset the HEAD to `master`)\n1. Run `urlzap generate`\n1. Commit and push\n\nThe following script follows what is described on the steps above:\n\n```sh\n#!/bin/bash\n\n# adds, commit and push your changes\ngit add config.yml\ngit commit -m 'chore: update config.yml'\ngit push -u origin main\n\n# make gh-pages branch to be the same as main\ngit checkout gh-pages\ngit reset --hard origin/main\n\n# generate files\nurlzap generate\n\n# add, commit and push generated files\ngit add --all\ngit commit -m 'chore: update HTML files'\ngit push -u origin gh-pages --force\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoluiz%2Furlzap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunoluiz%2Furlzap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoluiz%2Furlzap/lists"}