From e820e9e1af18b7ec556f9bfc7c8f202c7aac3100 Mon Sep 17 00:00:00 2001 From: rdbtCVS <87152661+rdbtCVS@users.noreply.github.com> Date: Sun, 25 Oct 2026 01:40:39 +0000 Subject: [PATCH] Website: use one navigation bar across pages Co-Authored-By: OpenCode gpt-6.1-sol --- website/README.md | 4 ++++ website/build.mjs | 22 ++++++++++++-------- website/scripts/shots.mjs | 3 --- website/src/chrome.js | 8 ++++---- website/src/docs-page.js | 5 +++++ website/src/docs.html | 20 ++++++------------ website/src/index.html | 42 +------------------------------------- website/src/main.js | 8 +++----- website/src/style.css | 43 +++++++++++++-------------------------- 9 files changed, 50 insertions(+), 105 deletions(-) create mode 100644 website/src/docs-page.js diff --git a/website/README.md b/website/README.md index 8ac6e3910..9d1f8dc8d 100644 --- a/website/README.md +++ b/website/README.md @@ -10,6 +10,9 @@ stone texture and a pixel landscape drawn in code (`scripts/art.mjs`), and short releases, the community links and the contributors. Plain HTML, CSS and JavaScript; no framework and no runtime dependencies. +Home, Releases, Benchmarks and every Docs page share the header and phone menu rendered by +`build.mjs`, with the same links, theme switch and Download button. + ## Layout ``` @@ -29,6 +32,7 @@ src/main.js the home page: download buttons, recent releases, links, cont src/chrome.js the light/dark switch, the phone menu and GitHub fetching, shared by the pages src/releases-page.js the Releases page: the channel filter and the refresh from GitHub src/benchmarks-page.js the Benchmarks page: players' results from the telemetry server, the picker +src/docs-page.js the Docs pages: the shared theme switch and phone menu src/bench.js the Benchmarks tables, shared by build and page src/hardware.js the spec table estimates use (GPU TFLOPS and bandwidth, CPU single-thread score) src/estimate.js estimates for unmeasured hardware from the nearest measured machine diff --git a/website/build.mjs b/website/build.mjs index f871d5dbb..8b0954054 100644 --- a/website/build.mjs +++ b/website/build.mjs @@ -170,7 +170,7 @@ await writeFile(join(dist, "favicon.ico"), Buffer.concat([ico, png32])); const names = {}; const rewrite = (code) => code.replace(/"\.\/(\w+\.js)"/g, (all, file) => (names[file] ? `"./${names[file]}"` : all)); // Dependencies before what imports them. -const modules = ["markdown.js", "versions.js", "chrome.js", "hardware.js", "estimate.js", "releases.js", "contributors.js", "bench.js", "main.js", "releases-page.js", "benchmarks-page.js"]; +const modules = ["markdown.js", "versions.js", "chrome.js", "hardware.js", "estimate.js", "releases.js", "contributors.js", "bench.js", "main.js", "releases-page.js", "benchmarks-page.js", "docs-page.js"]; for (const file of modules) { const code = rewrite(await readFile(join(site, "src", file), "utf8")); names[file] = `${file.replace(".js", "")}.${fingerprint(code)}.js`; @@ -201,13 +201,16 @@ const baked = { const unavailable = `

The release notes could not be loaded here.

Read them on GitHub`; -// The top bar and the footer of the pages beside the home page (Releases, Benchmarks). -const navLinks = [["/#about", "About"], ["/releases", "Releases"], ["/benchmarks", "Benchmarks"], ["/docs/", "Docs"]]; -const siteNav = (current) => `