Load versions.json as a resource if we're in the unstable spec (#2258)
Some checks are pending
Spec / 🔎 Validate OpenAPI specifications (push) Waiting to run
Spec / 🔎 Check Event schema examples (push) Waiting to run
Spec / 🔎 Check OpenAPI definitions examples (push) Waiting to run
Spec / 🔎 Check JSON Schemas inline examples (push) Waiting to run
Spec / ⚙️ Calculate baseURL for later jobs (push) Waiting to run
Spec / 🐍 Build OpenAPI definitions (push) Blocked by required conditions
Spec / 📢 Run towncrier for changelog (push) Waiting to run
Spec / 📖 Build the spec (push) Blocked by required conditions
Spec / 🔎 Validate generated HTML (push) Blocked by required conditions
Spec / 📖 Build the historical backup spec (push) Blocked by required conditions
Spell Check / Spell Check with Typos (push) Waiting to run

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
Johannes Marbach 2025-12-04 19:25:07 +01:00 committed by GitHub
parent a5afe542c0
commit 22c0952003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -82,7 +82,14 @@ function appendVersion(parent, name, url) {
a.appendChild(text); 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(r => r.json())
.then(versions => { .then(versions => {
// Find the surrounding list element // Find the surrounding list element

View file

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