diff --git a/README.md b/README.md index e68e1741a..ef41d23df 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Rugnux is one executable in an archive on the release page, it into a directory of its own. On Linux x86-64, with or without an NVIDIA GPU: ``` -VERSION=1.0.0-rc.184 # the newest release on the page +VERSION=1.0.0 curl -L -O https://gitea.psi.ch/mx/jungfraujoch/releases/download/$VERSION/rugnux-$VERSION-linux-x86_64-cuda12.tgz mkdir -p rugnux-$VERSION && tar xzf rugnux-$VERSION-linux-x86_64-cuda12.tgz -C rugnux-$VERSION export PATH=$PWD/rugnux-$VERSION/bin:$PATH diff --git a/docs/RUGNUX.md b/docs/RUGNUX.md index b426e829a..1696fea56 100644 --- a/docs/RUGNUX.md +++ b/docs/RUGNUX.md @@ -53,7 +53,7 @@ Rugnux is one executable in an archive on the release page, https://gitea.psi.ch On Linux x86-64 (the other platforms are on [Download](RUGNUX_DOWNLOAD.md)): ``` -VERSION=1.0.0-rc.184 +VERSION=1.0.0 curl -L -O https://gitea.psi.ch/mx/jungfraujoch/releases/download/$VERSION/rugnux-$VERSION-linux-x86_64-cuda12.tgz mkdir -p rugnux-$VERSION && tar xzf rugnux-$VERSION-linux-x86_64-cuda12.tgz -C rugnux-$VERSION export PATH=$PWD/rugnux-$VERSION/bin:$PATH diff --git a/docs/RUGNUX_INSTALL.md b/docs/RUGNUX_INSTALL.md index a9b2d74be..7d7ac0af9 100644 --- a/docs/RUGNUX_INSTALL.md +++ b/docs/RUGNUX_INSTALL.md @@ -40,7 +40,7 @@ release page: give `tar` a destination of its own, or it will scatter those into whatever directory you are in: ``` -VERSION=1.0.0-rc.184 # the newest release on the page +VERSION=1.0.0 curl -L -O https://gitea.psi.ch/mx/jungfraujoch/releases/download/$VERSION/rugnux-$VERSION-linux-x86_64-cuda12.tgz mkdir -p /opt/rugnux-$VERSION tar xzf rugnux-$VERSION-linux-x86_64-cuda12.tgz -C /opt/rugnux-$VERSION diff --git a/docs/_ext/jfjoch_downloads.py b/docs/_ext/jfjoch_downloads.py index 5fed0c762..ce22b1ecd 100644 --- a/docs/_ext/jfjoch_downloads.py +++ b/docs/_ext/jfjoch_downloads.py @@ -7,8 +7,8 @@ archive. Every link is built from the version Sphinx was configured with (``release`` in docs/conf.py, which update_version.sh rewrites from VERSION), so no version string on the page is maintained by hand. The page's script (_static/jfjoch_downloads.js) then asks the Gitea API for the -newest published release and repoints the buttons at its assets - so a docs build older or newer -than the current release still offers the archives that exist, and says which ones do not. +release tagged with that same version and checks the buttons against its assets (URL, size, and +which platforms it lacks); later releases never move the links. The asset names follow CPack's naming in CMakeLists.txt; the regular expressions are what the script matches against the release's asset list, written loosely enough to survive a CUDA major diff --git a/docs/_static/jfjoch_downloads.js b/docs/_static/jfjoch_downloads.js index 8aaac7a54..ed4c16457 100644 --- a/docs/_static/jfjoch_downloads.js +++ b/docs/_static/jfjoch_downloads.js @@ -1,23 +1,24 @@ // SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only -// Download pages: repoint the buttons at the newest published release. +// Download pages: check the buttons against the release the documentation was built for. // -// The page is rendered with links for the version the documentation was built for -// (docs/_ext/jfjoch_downloads.py). That version may not be released yet, or may be behind the -// current release, so once the page is up this asks the Gitea API (anonymous, CORS-enabled) for -// the newest non-draft release and rewrites each button from that release's asset list: the -// matching asset's URL and size, or "not part of this release" where the platform has none. -// Without network access, or if the API answers anything but 200, the built-in links stand. +// The page is rendered with links for that version (docs/_ext/jfjoch_downloads.py). Once the page +// is up this asks the Gitea API (anonymous, CORS-enabled) for the release tagged with exactly that +// version - never the newest one, so later releases do not move the links - and rewrites each +// button from its asset list: the matching asset's URL and size, or "not part of this release" +// where the platform has none. Without network access, or if the API answers anything but 200 +// (the release is not published yet), the built-in links stand. (function main() { // Sphinx puts html_js_files into , before the page's body exists. if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", main); return; } - var API = "https://gitea.psi.ch/api/v1/repos/mx/jungfraujoch/releases?limit=10"; var blocks = document.querySelectorAll(".jfj-dl"); if (!blocks.length || !window.fetch) return; + var version = blocks[0].querySelector("[data-jfj=version]").textContent; + var API = "https://gitea.psi.ch/api/v1/repos/mx/jungfraujoch/releases/tags/" + encodeURIComponent(version); function megabytes(bytes) { return (bytes / 1048576).toFixed(bytes < 10485760 ? 1 : 0) + " MB"; @@ -50,9 +51,8 @@ fetch(API) .then(function (r) { return r.ok ? r.json() : Promise.reject(r.status); }) - .then(function (releases) { - var release = releases.filter(function (r) { return !r.draft && r.assets; })[0]; - if (release) apply(release); + .then(function (release) { + if (!release.draft && release.assets) apply(release); }) .catch(function () { /* offline or API unavailable: the built-in links stand */ }); })(); diff --git a/docs/conf.py b/docs/conf.py index a86991759..1eff4cff1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -71,7 +71,7 @@ mathjax3_config = { html_theme = 'sphinx_material' html_static_path = ['../broker/redoc-static.html', '_static'] # The home page's program cards and the download pages' buttons (docs/_static); the script asks -# the Gitea API for the newest release and repoints the download buttons at its assets. +# the Gitea API for the release of this `release` version and checks the buttons against its assets. html_css_files = ['jfjoch.css'] html_js_files = ['jfjoch_downloads.js'] #html_theme_options = {