pyrtan / sourcev0.14.0 · main

pyrtan / site / build.sh

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.
7set -eu
8out="${1:-out}"
9rm -rf "$out"
10mkdir -p "$out/console" "$out/catalog" "$out/rendezvous" "$out/source"
11out="$(cd "$out" && pwd)"
12cp site/CNAME "$out/"
13# The source: files, releases, branches and history, from this checkout's git.
14python3 site/source.py "$out/source"
15# The landing page carries the version of the pyrtan it was built with.
16version="$(pyrtan --version | cut -d' ' -f2)"
17sed "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).
19cp src/pyrtan/js/theme.js "$out/"
20cp 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).
25python3 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
33cp site/catalog/index.html "$out/catalog/"
34pyrtan console --out "$out/console/index.html"
35pyrtan check examples catalog --quiet
36python3 site/gate.py
37# The index and every tree file beside it, as <namespace>/<name>.toml.
38pyrtan 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`.
41pyrtan id wellknown site/names --domain "$(cat site/CNAME)" --out "$out"
42touch "$out/.nojekyll"
43echo "built $out: $(find "$out" -type f | wc -l) files"