From c037b4553ee3a6c392b5e951453b088150b2561c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 29 May 2026 10:58:06 +0200 Subject: [PATCH] Show uutils.github.io build commit on the playground page Alongside the coreutils WASM commit, record the website repo's commit/date in version.js (SITE_VERSION) and display it next to the existing build info on the playground. --- .github/workflows/website.yml | 10 ++++++++++ content/playground.md | 25 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f775a78f5..4aee8d6fc 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -154,14 +154,24 @@ jobs: commit_hash=$(git rev-parse HEAD) commit_short=$(git rev-parse --short HEAD) commit_date=$(git show -s --format=%cI HEAD) + # Record the uutils.github.io commit the site was built from + site_hash=$(git -C ../uutils.github.io rev-parse HEAD) + site_short=$(git -C ../uutils.github.io rev-parse --short HEAD) + site_date=$(git -C ../uutils.github.io show -s --format=%cI HEAD) { echo "const UUTILS_WASM_VERSION = {" echo " commit: \"${commit_hash}\"," echo " short: \"${commit_short}\"," echo " date: \"${commit_date}\"" echo "};" + echo "const SITE_VERSION = {" + echo " commit: \"${site_hash}\"," + echo " short: \"${site_short}\"," + echo " date: \"${site_date}\"" + echo "};" } > ../uutils.github.io/static/wasm/version.js echo "uutils WASM build: ${commit_short} (${commit_date})" + echo "site build: ${site_short} (${site_date})" fi - name: Run Zola diff --git a/content/playground.md b/content/playground.md index 9f3c6a13e..e4adf8d06 100644 --- a/content/playground.md +++ b/content/playground.md @@ -44,13 +44,24 @@ template = "page.html" }).join(" "); } } - // Show the uutils commit that was used to build the WASM binary - if (typeof UUTILS_WASM_VERSION !== "undefined") { - var el = document.getElementById("playground-version"); - var date = UUTILS_WASM_VERSION.date.split("T")[0]; - var url = "https://github.com/uutils/coreutils/commit/" + UUTILS_WASM_VERSION.commit; - el.innerHTML = 'Built from uutils/coreutils ' + - UUTILS_WASM_VERSION.short + ' (' + date + ')'; + // Show the uutils commit that was used to build the WASM binary, + // and the uutils.github.io commit the site itself was built from. + var el = document.getElementById("playground-version"); + if (el) { + var parts = []; + if (typeof UUTILS_WASM_VERSION !== "undefined") { + var date = UUTILS_WASM_VERSION.date.split("T")[0]; + var url = "https://github.com/uutils/coreutils/commit/" + UUTILS_WASM_VERSION.commit; + parts.push('Built from uutils/coreutils ' + + UUTILS_WASM_VERSION.short + ' (' + date + ')'); + } + if (typeof SITE_VERSION !== "undefined") { + var siteDate = SITE_VERSION.date.split("T")[0]; + var siteUrl = "https://github.com/uutils/uutils.github.io/commit/" + SITE_VERSION.commit; + parts.push('site ' + + SITE_VERSION.short + ' (' + siteDate + ')'); + } + el.innerHTML = parts.join(' · '); } });