Skip to main content

Really simple static website URL shortener

Project description

sus is a static site based URL shortener. Simple idea: generate a static site with a bunch of redirect-slug-goes-here/index.html files with nothing but an HTML redirect in them.

https://github.com/nkantar/sus/workflows/Automated%20Checks/badge.svg

Installation

# note: you’ll need Python 3.6 or higher
pip install sus

Usage

  1. Install package

  2. Have an input file ready

  3. Have a home.html file ready (optional)

  4. Run sus in the same directory as input

  5. Voilà—your results are in the output/ directory

Input

sus expects to find a file named input in the current directory, and each row consists of the redirect slug and destination URL, separated by a pipe (|). Lines starting with the hash # are considered comments and thus ignored, and blank lines are ignored as well.

E.g.,

nk | https://nkantar.com
sus | https://github.com/nkantar/sus

# this is a comment and will be ignored
# the blank line above will also be ignored

If one were to serve output/ on https://sus-example.nkantar.com, then https://sus-example.nkantar.com/nk would redirect to https://nkantar.com and https://sus-example.nkantar.com/sus would redirect to https://github.com/nkantar/sus.

That example site exists, and its repository can be found at https://github.com/nkantar/sus-example.nkantar.com.

Homepage

If sus finds a home.html file next to input, it will copy it to output/index.html, thereby generating a homepage. If it doesn’t, it will simply carry on.

Pronunciation

Much controversy has sparked around the pronunciation of the project’s name (no, it hasn’t). As such, here is the definitive guide on doing so, as conceived by the original author. Please note that—much like with GIF —others may have different ideas, and who’s to say the author knows what he’s talking about anyway?

“sus” is in this case pronounced as in “suspicious”, and Wiktionary helpfully provides the following guide:

Development

The project by default uses Poetry, and make install should get you up and running with all the dev dependencies. After that see other make commands for convenience. They correspond to CI checks required for changes to be merged in.

The main branch is the bleeding edge version. Git tags correspond to releases.

Contributing Guidelines

Contributions of all sorts are welcome, be they bug reports, patches, or even just feedback. Creating a new issue or pull request is probably the best way to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

This project is licensed under the MIT license. See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sus-1.3.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

sus-1.3.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file sus-1.3.0.tar.gz.

File metadata

  • Download URL: sus-1.3.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.7 Darwin/20.3.0

File hashes

Hashes for sus-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ad8621f83fcc37e8ba37b116d6be0c286eccd0e397bca2bf5e080a47f2395ae9
MD5 888fbb73843ffda7f76f6cff44d12e41
BLAKE2b-256 3e51f8678461f510f93e72c9fb57d9a21487a1f2abdca6a19a4133e1be4d4a63

See more details on using hashes here.

File details

Details for the file sus-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: sus-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.7 Darwin/20.3.0

File hashes

Hashes for sus-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 355b9dda33cbc6f495b334390638eb5c93a266ce7ba11ae99c86762ab3f0df80
MD5 0fe37882ef3df68f73511c0190efd8f3
BLAKE2b-256 70b17f4d6c612e6f588dbbe6a7d84012000067ee48281880debe82c1b5462340

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page