2,315 bytes · last changed 2026-10-27 in Merge main (typing indicator 0.12.0, public lobbies 0.13.0, no seeds) into identity; identity is release 0.14.0
| 1 | #!/bin/sh |
| 2 | # Assemble pyrtan.com into one static directory: the landing page, the |
| 3 | # console, the catalog (built from examples/ and catalog/), the hub list, the source, |
| 4 | # the names. Run from the |
| 5 | # repository root with pyrtan installed (`uv run site/build.sh`); the Pages |
| 6 | # workflow runs the same thing. |
| 7 | set -eu |
| 8 | out="${1:-out}" |
| 9 | rm -rf "$out" |
| 10 | mkdir -p "$out/console" "$out/catalog" "$out/rendezvous" "$out/source" |
| 11 | out="$(cd "$out" && pwd)" |
| 12 | cp site/CNAME "$out/" |
| 13 | # The source: files, releases, branches and history, from this checkout's git. |
| 14 | python3 site/source.py "$out/source" |
| 15 | # The landing page carries the version of the pyrtan it was built with. |
| 16 | version="$(pyrtan --version | cut -d' ' -f2)" |
| 17 | sed "s/__VERSION__/$version/g" site/index.html > "$out/index.html" |
| 18 | # The wordmark's colour picker, shared by the landing page and the catalog (the console inlines it). |
| 19 | cp src/pyrtan/js/theme.js "$out/" |
| 20 | cp site/rendezvous/hubs.json site/rendezvous/network.json "$out/rendezvous/" |
| 21 | # The directory as the hubs know it now (the hub list, then every hub the |
| 22 | # last snapshot or a hub names), the default network's part only, keeping |
| 23 | # the last published snapshot's entries for hubs that are down |
| 24 | # (SNAPSHOT_PREVIOUS may add more). |
| 25 | python3 site/snapshot.py site/rendezvous/hubs.json "$out/rendezvous/directory.json" \ |
| 26 | --network site/rendezvous/network.json \ |
| 27 | --previous https://pyrtan.com/rendezvous/directory.json \ |
| 28 | --previous https://b-i-t-8.github.io/pyrtan/rendezvous/directory.json \ |
| 29 | ${SNAPSHOT_PREVIOUS:+--previous "$SNAPSHOT_PREVIOUS"} \ |
| 30 | --reports "$out/rendezvous/reports.json" \ |
| 31 | --previous-reports https://pyrtan.com/rendezvous/reports.json \ |
| 32 | --previous-reports https://b-i-t-8.github.io/pyrtan/rendezvous/reports.json |
| 33 | cp site/catalog/index.html "$out/catalog/" |
| 34 | pyrtan console --out "$out/console/index.html" |
| 35 | pyrtan check examples catalog --quiet |
| 36 | python3 site/gate.py |
| 37 | # The index and every tree file beside it, as <namespace>/<name>.toml. |
| 38 | pyrtan index examples catalog --copy "$out/catalog" --require-namespace |
| 39 | # Names: site/names/ served as /.well-known/pyrtan/ (name claims, identity |
| 40 | # documents, and names.json listing them), for `pyrtan id resolve`. |
| 41 | pyrtan id wellknown site/names --domain "$(cat site/CNAME)" --out "$out" |
| 42 | touch "$out/.nojekyll" |
| 43 | echo "built $out: $(find "$out" -type f | wc -l) files" |