diff --git a/oreo.elixpo/public/og-banner.jpg b/oreo.elixpo/public/og-banner.jpg new file mode 100644 index 0000000..ba74612 Binary files /dev/null and b/oreo.elixpo/public/og-banner.jpg differ diff --git a/oreo.elixpo/src/app/layout.tsx b/oreo.elixpo/src/app/layout.tsx index 69bf92a..7ddc8b4 100644 --- a/oreo.elixpo/src/app/layout.tsx +++ b/oreo.elixpo/src/app/layout.tsx @@ -10,12 +10,11 @@ import PageTransition from "@/components/PageTransition"; // Keeping a single image for both surfaces means a contributor only // has to refresh one file when the brand shifts. -const SITE_TITLE = "OreoOS — a Python OS in a pocket-sized badge"; +const SITE_TITLE = "OreoOS — an open-source OS in a pocket-sized badge"; const SITE_DESCRIPTION = - "Open hardware. Open firmware. 20+ apps, on-device store, OTA over " + - "WiFi, AirDrop-style file transfer. MicroPython on ESP32-S3."; + "OreoOS - Micropython inside your pocket"; const SITE_URL = "https://oreo.elixpo.com"; -const OG_IMAGE = "/og-banner.png"; +const OG_IMAGE = "/og-banner.jpg"; export const metadata: Metadata = { metadataBase: new URL(SITE_URL), @@ -49,7 +48,7 @@ export const metadata: Metadata = { url: OG_IMAGE, width: 1200, height: 630, - alt: "Oreo Badge — a Python OS in a pocket-sized conference badge", + alt: "Oreo Badge, with your favourite mascot and a stylish lanyard!" }], }, twitter: { diff --git a/oreo.elixpo/src/app/upload/page.tsx b/oreo.elixpo/src/app/upload/page.tsx index 11058bc..52ac5e8 100644 --- a/oreo.elixpo/src/app/upload/page.tsx +++ b/oreo.elixpo/src/app/upload/page.tsx @@ -153,7 +153,7 @@ export default function UploadPage() { return; } const url = new URL(`http://${normalizedHost}/`); - url.searchParams.set("prefill", hashHex); + url.searchParams.set("prefill", hash); const safeTargetUrl = url.toString(); // ── Fire window.open SYNCHRONOUSLY inside the user gesture ── diff --git a/tools/deploy.py b/tools/deploy.py index 122066e..c7e8ffd 100644 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -4,6 +4,12 @@ python tools/deploy.py # auto-detect port python tools/deploy.py /dev/ttyACM0 python tools/deploy.py --clean # wipe device first + python tools/deploy.py --website # build + ship the + # Cloudflare Pages site + # in oreo.elixpo/ (no + # badge interaction) + python tools/deploy.py --website --preview # deploy to branch alias + # instead of production python tools/deploy.py --override=gallery,reader # before the push, wipe the named app dirs on device (and force # any of their files in our hash cache to re-push). Use this when @@ -469,9 +475,62 @@ def write_secrets_local(): remote_dirs = sorted(remote_dirs, key=lambda p: p.count("/")) +# ── website deploy ─────────────────────────────────────────────────────────── + +WEBSITE_DIR = Path("oreo.elixpo") +WEBSITE_PROJECT = "oreo" # Cloudflare Pages project name + +def deploy_website(): + """Build the Next.js static export and push it to Cloudflare Pages. + Production by default; pass `--preview` for a branch-alias deploy. + + The site lives in oreo.elixpo/ and exports to oreo.elixpo/out/. We + shell out to the project's own `next build` + `wrangler pages + deploy` so behaviour stays identical whether the user runs this + helper or the package.json `deploy` script directly. + """ + if not WEBSITE_DIR.is_dir(): + print("Cannot find website directory: %s/" % WEBSITE_DIR) + sys.exit(1) + preview = "--preview" in sys.argv + + print("Building Next.js static export in %s/..." % WEBSITE_DIR) + rc = subprocess.call(["npx", "next", "build"], cwd=str(WEBSITE_DIR)) + if rc != 0: + print("next build failed (exit %d)" % rc) + sys.exit(rc) + + out_dir = WEBSITE_DIR / "out" + if not out_dir.is_dir(): + print("Build did not produce %s/" % out_dir) + sys.exit(1) + + # `--branch=main` pins the deploy to the production alias so the + # custom domain (oreo.elixpo.com) actually serves the new bytes. + # Without it wrangler defaults to the current git branch, which + # only updates the branch-alias preview URL. + cmd = ["npx", "wrangler", "pages", "deploy", "out", + "--project-name=" + WEBSITE_PROJECT] + if not preview: + cmd.append("--branch=main") + print("Deploying to Cloudflare Pages (%s)..." % + ("preview" if preview else "production")) + rc = subprocess.call(cmd, cwd=str(WEBSITE_DIR)) + if rc != 0: + print("wrangler deploy failed (exit %d)" % rc) + sys.exit(rc) + print("Website deploy complete.") + + # ── main ────────────────────────────────────────────────────────────────────── def main(): + # Website-only path — short-circuits everything ESP-related so the + # user can ship the site without a badge attached. + if "--website" in sys.argv: + deploy_website() + return + import time as _t t0 = _t.time() if "--no-bump" not in sys.argv: