Load versions.json as a resource if we're in the unstable spec

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
Johannes Marbach 2025-12-04 18:35:01 +01:00
parent a5afe542c0
commit bdbbb56178
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -0,0 +1 @@
Add version picker in the navbar.