File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ $ ( function ( ) {
2+ let version_path_index = 4 ;
3+ $ ( '.card-wrapper > div > a' ) . each ( function ( ) {
4+ let destUrl = $ ( this ) . attr ( 'href' ) ;
5+ if ( '//' === destUrl . substring ( 0 , 2 ) ) {
6+ destUrl = document . location . protocol + destUrl ;
7+ } else if ( '/' === destUrl . substring ( 0 , 1 ) ) {
8+ destUrl = document . location . protocol + '//' + document . location . host + destUrl ;
9+ }
10+ destUrl = new URL ( destUrl ) ;
11+ let destPath = destUrl . pathname . split ( '/' ) ,
12+ srcPath = document . location . pathname . split ( '/' ) ;
13+ if ( destPath [ version_path_index ] !== srcPath [ version_path_index ] ) {
14+ destPath [ version_path_index ] = srcPath [ version_path_index ] ;
15+ }
16+ destUrl . pathname = destPath . join ( '/' ) ;
17+ $ ( this ) . attr ( 'href' , destUrl . href ) ;
18+ } ) ;
19+ } ) ;
Original file line number Diff line number Diff line change @@ -188,6 +188,7 @@ extra_javascript:
188188 - js/jquery-ui.min.js
189189 - js/custom.js
190190 - js/docs.switcher.js
191+ - js/cards.js
191192 - ' //cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js'
192193
193194markdown_extensions :
You can’t perform that action at this time.
0 commit comments