File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,11 +84,29 @@ const guideSidebar = [
8484 } ,
8585] ;
8686
87+ // Script to force hard navigation for version switching links
88+ // VitePress SPA router can't handle navigation between separate VitePress builds
89+ const versionSwitchScript = `
90+ document.addEventListener('click', (e) => {
91+ const link = e.target.closest('a');
92+ if (!link) return;
93+ 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/'))) {
96+ e.preventDefault();
97+ e.stopPropagation();
98+ window.location.href = link.href;
99+ }
100+ }, true);
101+ ` ;
102+
87103export default defineConfig ( {
88104 title : 'B2C DX' ,
89105 description : 'Salesforce Commerce Cloud B2C Developer Experience - CLI, MCP Server, and SDK' ,
90106 base : basePath ,
91107
108+ head : [ [ 'script' , { } , versionSwitchScript ] ] ,
109+
92110 // Ignore dead links in api-readme.md (links are valid after TypeDoc generates the API docs)
93111 ignoreDeadLinks : [ / ^ \. \/ c l i e n t s \/ / ] ,
94112
You can’t perform that action at this time.
0 commit comments