Skip to content
/ unia.xyz Public
forked from dat-leth/unia.xyz

A simple URL shortener from unia.xyz to University of Augsburg's webpages

License

Notifications You must be signed in to change notification settings

asinf/unia.xyz

 
 

Repository files navigation

unia.xyz

A simple URL shortener from unia.xyz to University of Augsburg's webpages hosted on Cloudflare Pages and using Cloudflare's speedy CDN-based Redirects API.

Add or update short URLs

Ensure you have python3 and pip3 installed. Create a venv using python3 -v venv venv and follow by activating it using source myvenv/bin/activate. Then install the necessary dependencies by running pip3 install -r requirements.txt.

Modify redirects.toml and run python3 build.py. The build script will then parse the routing rules and generate the webpage and redirects file for Netlify.

  1. Fork this repository.
  2. Make changes as necessary.
  3. Commit and push changes to your own fork.
  4. Open a Pull Request on GitHub.

If your Pull Request is accepted and merged into main, all changes will be automagically deployed and you will be able to see your changes on unia.xyz within minutes.

Build script

Quickly hacked together, but it works. And it works in the following way:

  • Parse ./redirects.toml.
  • Fetch Base CSS from jsdelivr. We are using new.css.
  • Minify Custom CSS with rcssmin.
  • Create output folder ./out/ if not exists.
  • Generate ./out/index.html using Jinja2.
  • Generate ./out/_redirects using Jinja2

About

A simple URL shortener from unia.xyz to University of Augsburg's webpages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 57.6%
  • Jinja 37.3%
  • CSS 5.1%