Team Arion's URL shortener. It works by compiling a static site with a redirecting router. The static site is hosted on Cloudflare Pages.
Tip
How to use?
Short links: Edit shortlinks/links.yaml, push to main, and wait a few minutes for Cloudflare to rebuild.
Outbound links: Use https://go.teamarion.org/outbound/generate to generate a site-leaving warning page.
Changes usually appear after the next deploy finishes.
Note
This service is for Team Arion members only.
This repo builds a static short link router plus outbound warning pages for Cloudflare Pages. Redirects are defined in shortlinks/links.yaml and compiled into dist/ by shortlinks/build.py.
shortlinks/links.yamlRedirect definitions.shortlinks/build.pyBuild script.shortlinks/templates/router.htmlRouter page template.shortlinks/templates/outbound.htmlOutbound warning template.shortlinks/templates/generate.htmlGenerator template.shortlinks/assets/site.cssShared theme styles.shortlinks/assets/router.jsRouter logic.shortlinks/assets/outbound.jsOutbound warning logic.shortlinks/assets/generate.jsGenerator logic.outbound/logo.pngLogo source for outbound pages.dist/Build output (generated)..github/workflows/deploy.ymlGitHub Actions workflow.
- Python 3.11+
- Install dependencies:
pip install -r shortlinks/requirements.txt- Build the site:
python shortlinks/build.py- Inspect output:
ls distshortlinks/links.yaml is a mapping of short codes to URLs:
home:
url: https://teamarion.org
title: Team Arion
instagram:
url: https://www.instagram.com/teamarionhk/Rules:
- Each key is the short code (e.g.
homebecomes/home). urlis required.titleis optional; if omitted, the page title defaults toRedirecting.
After editing links.yaml, rerun the build.
The build produces:
dist/index.htmlRouter page that reads the URL path.dist/links.jsonLookup table generated fromlinks.yaml.dist/assets/Shared CSS/JS assets.dist/outbound/index.htmlOutbound warning page.dist/outbound/generate/index.htmlOutbound link generator.dist/outbound/logo.png(ifoutbound/logo.pngexists).dist/_redirectsRewrite rules for Cloudflare Pages.
Example:
homebecomeshttps://go.teamarion.org/homevia the router page.
Cloudflare builds and serves dist/. GitHub Actions can still run the build for CI validation, but it does not deploy.
Workflow highlights:
- Installs Python dependencies
- Runs
shortlinks/build.py
Cloudflare Pages settings:
- Framework preset:
None - Build command:
pip install -r shortlinks/requirements.txt && python shortlinks/build.py - Build output directory:
dist - Root directory (advanced): leave blank
Usage:
https://go.teamarion.org/outbound/<encoded-url>- Example:
https://go.teamarion.org/outbound/https%3A%2F%2Fexample.com
Notes:
- The page only allows
httpandhttpsdestinations. ?to=query parameter is also supported as a fallback.
Generator:
https://go.teamarion.org/outbound/generate
To verify output after a build, confirm these files exist in dist/:
index.htmllinks.json_redirectsassets/site.css
- If YAML is invalid,
build.pyexits with a clear error message. - If no links are defined, the build completes with an empty lookup table.