From 0268089f7e6d015ab43ef2373fd5984e8dbb2184 Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:21:02 +0000 Subject: [PATCH 1/2] fix: version banner links to stable version of current page (#26857) Replace hardcoded /en/stable/ link with path-relative URL that preserves the current page when redirecting to the stable docs version. --- docs/assets/versions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/assets/versions.js b/docs/assets/versions.js index 08bd9e59033ad..472795eb9763f 100644 --- a/docs/assets/versions.js +++ b/docs/assets/versions.js @@ -139,10 +139,11 @@ window.addEventListener("DOMContentLoaded", function() { var headerHeight = document.getElementsByClassName("md-header")[0].offsetHeight; const currentVersion = getCurrentVersion(); if (currentVersion && currentVersion !== "stable") { + var stablePath = window.location.pathname.replace(VERSION_REGEX, '/en/stable/'); if (currentVersion === "latest") { - document.querySelector("div[data-md-component=announce]").innerHTML = "
You are viewing the docs for an unreleased version of Argo CD, view the latest stable version.
"; + document.querySelector("div[data-md-component=announce]").innerHTML = "
You are viewing the docs for an unreleased version of Argo CD, view the latest stable version.
"; } else { - document.querySelector("div[data-md-component=announce]").innerHTML = "
You are viewing the docs for a previous version of Argo CD, view the latest stable version.
"; + document.querySelector("div[data-md-component=announce]").innerHTML = "
You are viewing the docs for a previous version of Argo CD, view the latest stable version.
"; } var bannerHeight = document.getElementById('announce-msg').offsetHeight + margin; document.querySelector("header.md-header").style.top = bannerHeight + "px"; From a6728c9f55f4ca2fc46f243168c368c8a5194412 Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:21:50 +0000 Subject: [PATCH 2/2] fix: use absolute URL with domain for stable version banner links Prepend the readthedocs domain to the dynamically constructed path so that the version banner links remain absolute URLs as expected. --- docs/assets/versions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/versions.js b/docs/assets/versions.js index 472795eb9763f..44b7d22a98cb6 100644 --- a/docs/assets/versions.js +++ b/docs/assets/versions.js @@ -139,7 +139,7 @@ window.addEventListener("DOMContentLoaded", function() { var headerHeight = document.getElementsByClassName("md-header")[0].offsetHeight; const currentVersion = getCurrentVersion(); if (currentVersion && currentVersion !== "stable") { - var stablePath = window.location.pathname.replace(VERSION_REGEX, '/en/stable/'); + var stablePath = 'https://argo-cd.readthedocs.io' + window.location.pathname.replace(VERSION_REGEX, '/en/stable/'); if (currentVersion === "latest") { document.querySelector("div[data-md-component=announce]").innerHTML = "
You are viewing the docs for an unreleased version of Argo CD, view the latest stable version.
"; } else {