Skip to content

fix: 'Previous version' banner should redirect to#26862

Open
JiwaniZakir wants to merge 2 commits intoargoproj:masterfrom
JiwaniZakir:fix/issue-26857
Open

fix: 'Previous version' banner should redirect to#26862
JiwaniZakir wants to merge 2 commits intoargoproj:masterfrom
JiwaniZakir:fix/issue-26857

Conversation

@JiwaniZakir
Copy link

Fixes #26857

The version warning banner in docs/assets/versions.js always linked to the stable docs home page (/en/stable/) regardless of which page the user was currently viewing. The root cause was that the href values were hardcoded to https://argo-cd.readthedocs.io/en/stable/ in both the latest and previous-version branches of the DOMContentLoaded listener. Fixes this by computing stablePath using window.location.pathname.replace(VERSION_REGEX, '/en/stable/') and prepending the argo-cd.readthedocs.io origin, so the banner link points to the equivalent page on the stable version. Verified by reviewing that the constructed URL preserves the absolute URL format expected by the original code while dynamically replacing the version segment in the path.

…#26857)

Replace hardcoded /en/stable/ link with path-relative URL that preserves
the current page when redirecting to the stable docs version.
Prepend the readthedocs domain to the dynamically constructed path
so that the version banner links remain absolute URLs as expected.
@JiwaniZakir JiwaniZakir requested review from a team as code owners March 16, 2026 21:22
@bunnyshell
Copy link

bunnyshell bot commented Mar 16, 2026

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-g3hb6d.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-g3hb6d.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Copy link
Member

@sivchari sivchari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but DCO is failed. Please sign to your commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Previous version' banner should redirect to /stable/<current-page> instead of docs home page

2 participants