From 22c095200322b13436a1e3c5a8c2b237ecf37514 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 4 Dec 2025 19:25:07 +0100 Subject: [PATCH] Load versions.json as a resource if we're in the unstable spec (#2258) Signed-off-by: Johannes Marbach --- assets/js/versions.template.js | 9 ++++++++- changelogs/internal/newsfragments/2258.clarification | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelogs/internal/newsfragments/2258.clarification diff --git a/assets/js/versions.template.js b/assets/js/versions.template.js index 79fcbc8d..b45b346e 100644 --- a/assets/js/versions.template.js +++ b/assets/js/versions.template.js @@ -82,7 +82,14 @@ function appendVersion(parent, name, url) { a.appendChild(text); } -fetch("/latest/versions.json") +// If we're in the unstable version, we're the latest thing and can just load +// versions.json from our own resources. Otherwise, we fall back to loading it +// from /unstable/versions.json, assuming we are on the spec.matrix.org deployment. +const url = currentVersion === "unstable" + ? '{{ "/" | relURL }}versions.json' + : "/unstable/versions.json"; + +fetch(url) .then(r => r.json()) .then(versions => { // Find the surrounding list element diff --git a/changelogs/internal/newsfragments/2258.clarification b/changelogs/internal/newsfragments/2258.clarification new file mode 100644 index 00000000..468f55d5 --- /dev/null +++ b/changelogs/internal/newsfragments/2258.clarification @@ -0,0 +1 @@ +Add version picker in the navbar.