A better download page: a hero over the Cove with the download for your computer, the trailer, what you'll do, what's new and how to report a bug, screenshots (tools/site/make_shots.sh), downloads, and playing with friends with the ports

This commit is contained in:
Paul Bailey
2026-11-07 13:24:46 +00:00
parent 3b611a6d34
commit 04b9d17826
6 changed files with 462 additions and 93 deletions

View File

@@ -7,6 +7,7 @@
# build/site/index.html the page, with this release's download links
# build/site/poster.jpg the trailer's title frame
# build/site/trailer.mp4 the trailer (tools/trailer/make_trailer.sh)
# build/site/shots/ the screenshots (tools/site/make_shots.sh)
#
# Copy the folder to any static web host. Gitea itself won't serve HTML, so
# the page lives elsewhere and links to the files on the Gitea release.
@@ -14,15 +15,23 @@
cd "$(dirname "$0")/../.." || exit 1
REPO=${REPO:-https://git.psbailey.uk/Admin/Emberwild}
SITE=${SITE:-https://emberwild-95k.pages.dev} # (where the page is served: for link previews)
SHOTS="meadow hut wolves winter cove treasure crabs"
[ -f build/version.json ] || { echo "no build/version.json: run tools/export.sh first"; exit 1; }
[ -f build/Emberwild-trailer.mp4 ] || { echo "no trailer: run tools/trailer/make_trailer.sh first"; exit 1; }
for s in $SHOTS; do
[ -f "build/shots/$s.jpg" ] || { echo "no build/shots/$s.jpg: run tools/site/make_shots.sh first"; exit 1; }
done
rm -rf build/site && mkdir -p build/site
cp build/Emberwild-trailer.mp4 build/site/trailer.mp4
cp build/trailer/poster.jpg build/site/poster.jpg
python3 - "$REPO" <<'EOF'
mkdir -p build/site/shots
for s in $SHOTS; do cp "build/shots/$s.jpg" build/site/shots/; done
python3 - "$REPO" "$SITE" <<'EOF'
import html, json, sys
repo = sys.argv[1].rstrip("/")
site = sys.argv[2].rstrip("/")
v = json.load(open("build/version.json"))
tag = "v" + v["version"]
def dl(plat):
@@ -36,7 +45,7 @@ page = open("tools/site/index.html").read()
for k, val in {
"VERSION": v["version"], "DATE": v.get("date", ""), "NOTES": v.get("notes", ""),
"MAC_URL": mac_url, "MAC_SIZE": mac_size, "WIN_URL": win_url, "WIN_SIZE": win_size,
"RELEASES_URL": repo + "/releases",
"RELEASES_URL": repo + "/releases", "REPO_URL": repo, "SITE_URL": site,
}.items():
page = page.replace("{{%s}}" % k, html.escape(str(val), quote=True))
assert "{{" not in page, "a placeholder was left unfilled"
@@ -55,7 +64,8 @@ rm -f "$DATA"
# Cloudflare Pages refuses any file over 25 MiB: catch it here, not at deploy.
LIMIT=26214400
for f in build/site/*; do
for f in build/site/* build/site/shots/*; do
[ -f "$f" ] || continue
s=$(stat -f %z "$f" 2>/dev/null || stat -c %s "$f")
if [ "$s" -ge "$LIMIT" ]; then
echo "$f is $s bytes: over Cloudflare Pages' 25 MiB limit (re-encode the trailer smaller)"; exit 1