aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-08-11 17:41:01 -0400
committerJoe Mou <dev@mou.fo>2026-08-11 18:25:26 -0400
commit950d7e430b833f3e428f1af100f6fb74bdd76a2d (patch)
tree0cbce0844a83dd9489e49d6eba3b476094b57129 /public
parent32ed69b43aeca42e88ab37187246e1035d4c933f (diff)
Read the About box and latest release from JSON
GitHub rebuilt the repository sidebar, so the selectors parseRepoInfo used matched nothing and the About box rendered empty. Everything but the latest release is in the page's embedded payload as sidebarAbout; the latest release is only in the _sidebar JSON already fetched for languages, so it arrives with that fragment and is moved beside the release count.
Diffstat (limited to 'public')
-rw-r--r--public/static/refs.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/public/static/refs.js b/public/static/refs.js
index f3e07e8..1035593 100644
--- a/public/static/refs.js
+++ b/public/static/refs.js
@@ -52,10 +52,20 @@ document.addEventListener("DOMContentLoaded", () => {
.then((html) => {
if (html.trim()) {
placeholder.outerHTML = html;
+ relocate();
} else {
placeholder.remove();
}
})
.catch(() => placeholder.remove());
}
+
+ // A fragment may carry a node that belongs elsewhere on the page, where an
+ // empty element of that id holds its spot: the sidebar's latest release
+ // reads as part of the release count, far from the languages it arrives with.
+ function relocate() {
+ for (const node of document.querySelectorAll("[data-target]")) {
+ document.getElementById(node.dataset.target)?.replaceWith(node);
+ }
+ }
});