Site: trailer encoded smaller (CRF 23, 3.5 Mbit/s cap) to fit Cloudflare Pages' 25 MiB file limit; make_site.sh refuses an oversized file

This commit is contained in:
Paul Bailey
2026-11-06 21:06:08 +00:00
parent 2b7e52cd82
commit b86fb879d2
2 changed files with 10 additions and 1 deletions

View File

@@ -52,3 +52,12 @@ DATA=build/site_data.json
|| { echo "couldn't dump the game data for the guide"; exit 1; }
python3 tools/site/make_guide.py "$DATA" build/site || exit 1
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
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
fi
done