Site: read the newest version from Gitea; links follow releases/latest [skip ci]

A worker answers /release.json from the Gitea API (Gitea sends no
CORS headers, so the page cannot ask it directly).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-13 13:35:58 -04:00
1 parent 48306fcd16
commit 87c42fde0e
14 files changed
+76 -16

No files matched your search

+3 -2
View File
@@ -8,7 +8,7 @@ import { rhythm } from "./rhythm.ts";
import { playground } from "./play.ts";
import { film } from "./film.ts";
import { said, speak, type Lang } from "./text.ts";
import { RELEASES, VERSION } from "./release.ts";
import { RELEASES, latest } from "./release.ts";
const REPO = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice";
@@ -35,7 +35,8 @@ const shelf = props();
const footer = document.createElement("footer");
footer.id = "download";
const version = document.createElement("h2");
version.textContent = `Ely Office ${VERSION}`;
version.textContent = "Ely Office";
void latest().then((v) => (version.textContent = `Ely Office ${v}`));
const get = said("a", "get");
get.href = RELEASES;
footer.append(version, said("p", "platforms"), said("p", "needs"), said("p", "unsigned"), get);
+10 -3
View File
@@ -1,3 +1,10 @@
// This version's release page holds every download.
export const VERSION = "0.1.4";
export const RELEASES = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice/releases/tag/v0.1.4";
// Gitea redirects this to the newest release.
export const RELEASES = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice/releases/latest";
/** The newest release's version, from the worker. */
export async function latest(): Promise<string> {
const res = await fetch("/release.json");
if (!res.ok) throw new Error(`release.json: ${res.status} ${await res.text()}`);
const { version } = (await res.json()) as { version: string };
return version;
}