File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,11 +91,19 @@ document.addEventListener('click', (e) => {
9191 const link = e.target.closest('a');
9292 if (!link) return;
9393 const href = link.getAttribute('href');
94- // Check if this is a version switch link (contains /release/ or is ../)
95- if (href && (href.includes('/release/') || href === '../' || href.endsWith('/release/') )) {
94+ // Check if this is a version switch link
95+ if (href && (href.includes('/release/') || href === '../')) {
9696 e.preventDefault();
9797 e.stopPropagation();
98- window.location.href = link.href;
98+ if (href === '../') {
99+ // Navigate from /release/ back to main - construct path explicitly
100+ // to avoid relative path issues with trailing slashes
101+ const path = window.location.pathname;
102+ const mainPath = path.replace(/\\/release\\/.*$/, '/').replace(/\\/release$/, '/');
103+ window.location.href = mainPath;
104+ } else {
105+ window.location.href = link.href;
106+ }
99107 }
100108}, true);
101109` ;
You can’t perform that action at this time.
0 commit comments