diff --git a/tools/fleet/publish-fleet.sh b/tools/fleet/publish-fleet.sh index eb9cb932c..89d942e6a 100755 --- a/tools/fleet/publish-fleet.sh +++ b/tools/fleet/publish-fleet.sh @@ -7,6 +7,24 @@ JSON="${1:?fleet.json path}" DLSITE="$(cat "$HOME/.config/igneum/dlsite-dir")"; P="$(cat "$HOME/.config/igneum/fleet-path")" python3 -c "import json,sys; json.load(open(sys.argv[1]))" "$JSON" cp "$JSON" "$DLSITE/$P/fleet.json" +# The Fleet | Workers nav is part of the page for good (6 October 2026, the project lead: the link was missing): re-insert it and its +# four CSS lines whenever an index.html regeneration dropped them. Absolute paths: the host serves the folder without a slash. +python3 - "$DLSITE/$P/index.html" "$P" <<'PY' +import sys, re +f, p = sys.argv[1], sys.argv[2]; s = open(f).read() +nav = f'' +css = """ nav { display: flex; gap: 2px; border: 1px solid var(--line); } + nav a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 7px 12px; } + nav a.on { color: var(--ink); background: var(--panel-2); } + nav a:hover { color: var(--ember-2); } +""" +changed = False +if "nav {" not in s: s = s.replace("", css + "", 1); changed = True +if "workers.html" not in s: + m = re.search(r"]*>", s) or re.search(r"]*>", s) + s = s[:m.end()] + "\n " + nav + s[m.end():]; changed = True +if changed: open(f, "w").write(s); print("fleet index.html: nav restored") +PY (cd "$DLSITE" && npx --yes vercel@latest --global-config "$HOME/.config/igneum/vercel" deploy --prod --yes >/dev/null 2>&1) || { echo "deploy failed" >&2; exit 1; } for i in $(seq 1 12); do if curl -fsS --max-time 10 "https://dl.igneum.network/$P/fleet.json?t=$(date +%s)" | python3 -c "import json,sys; d=json.load(sys.stdin); sys.exit(0 if d.get('spend',{}).get('updated_at')==json.load(open('$JSON')).get('spend',{}).get('updated_at') else 1)" 2>/dev/null; then echo "live: https://dl.igneum.network/$P/"; exit 0; fi