all-relative
A command line tool to convert a static site to use only relative urls.
Run it from the the directory which contains your generated static site to have it convert all urls in html and css to be relative to that dir or specify it as a cli argument.
Relative urls leaves you with a portable website that doesn't care what path it is mounted at. /, /olizilla/ /ipfs/hash/, file://x/y/z/, the lot, it don't care. This allows you to load the same static site via IPFS or github pages, or the localfile system, as well as from the root of your custom domain. Relative urls are wonderful.
The command will edit the files in place, so it's best to run it on generated output that you can recreate if you need to. If you can't, be sure to take a back up of your site first.
Install
Install it with
$ pip install all-relative
or run just it wihtout installing it via pipx see here if you haven't heard about it
$ pipx all-relative
Usage
Run the command from the root directory of your static site.
$ all-relative
Inspired by all-relative
Release files for all-relative 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| all-relative-0.1.8.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| all_relative-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / all-relative-0.1.8.tar.gz
| Download URL | all-relative-0.1.8.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90be644777f3da3d486d294b84a582a968c5be97d4cefded498e3c9b1668ae05
|
|
BLAKE2b-256 checksum How to use checksums |
89d2cf47e50068f0762792bc647dc48d56b1bb5b318f6d873537078f7fc4b2d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
|
Release files / all_relative-0.1.8-py3-none-any.whl
| Download URL | all_relative-0.1.8-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0a967c0464bbed0e7a5c9d07169b0c7c818dce80673da97d64d2f5dcadaf5d7
|
|
BLAKE2b-256 checksum How to use checksums |
022d27f9062656e4561c3b789b8e3617b637cbea30db0c6ed356dd672f7a5a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1032-azure
|