Web version on the site: /app/ from website/static/app, precompressed Brotli/gzip

The site serves precompressed copies next to its files (the program is 19 MB,
6.3 MB in Brotli); the built program goes to website/static/app (ignored by git,
taken into the image); the device page's screenshots by the site's own paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-30 15:33:26 +03:00
parent dd1f3c6c28
commit 4ccf8099a5
4 changed files with 13 additions and 3 deletions

View file

@ -23,7 +23,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
def translate_path(self, path):
path = path.split("?", 1)[0].split("#", 1)[0]
for prefix, base in (("/app/", APP), ("/static/", STATIC)):
for prefix, base in (("/app/", APP), ("/static/", STATIC), ("/screenshots/", STATIC / "screenshots")):
if path.startswith(prefix):
target = (base / path[len(prefix):]).resolve()
if target == base or base in target.parents:

View file

@ -92,7 +92,7 @@
function shots(names) {
return el("div", { class: "shots" }, names.map(function (n) {
return el("img", { src: "../static/screenshots/" + n, alt: "", loading: "lazy" });
return el("img", { src: "/screenshots/" + n, alt: "", loading: "lazy" });
}));
}