File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,20 @@ $(document).ready(function() {
1818 warningBox . hidden = false ;
1919 }
2020
21- $ ( '.md-content a.md-icon' ) . each ( function ( ) {
21+ if ( ! / ^ \d + \. \d + $ / . test ( branchName ) && branchName !== 'latest' ) {
22+ branchName = 'master' ;
23+ }
24+
25+ // Insert version into header links
26+ $ ( '.md-header a.md-logo, #site-name > a' ) . each ( function ( ) {
2227 $ ( this ) . attr (
2328 'href' ,
2429 $ ( this )
2530 . attr ( 'href' )
26- . replace ( 'master/docs/' , branchName + '/docs /' ) ,
31+ . replace ( / \/ e n \/ [ ^ \/ ] + \/ / , '/en/' + branchName + '/' ) ,
2732 ) ;
2833 } ) ;
2934
30- if ( ! / ^ \d + \. \d + $ / . test ( branchName ) && branchName !== 'latest' ) {
31- branchName = 'master' ;
32- }
33-
3435 // Add version pill to top of navigation
3536 $ ( '#site-name' ) . append ( '<span class="pill">' + branchName + '</span>' ) ;
3637
Original file line number Diff line number Diff line change 1919 < div class ="main_nav ">
2020 < div class ="main_nav_content ">
2121 < div class ="site-header " id ="site-name ">
22- < a href ="/ "> {{ config.site_name }}</ a >
22+ {% set site_url = config.site_url | default(nav.homepage.url, true) | url %}
23+ {% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
24+ {% set site_url = site_url ~ "/index.html" %}
25+ {% endif %}
26+ < a href ="{{ site_url }} "> {{ config.site_name }}</ a >
2327 </ div >
2428 < div class ="md-sidebar md-sidebar--primary " data-md-component ="navigation ">
2529 < div class ="md-sidebar__scrollwrap ">
You can’t perform that action at this time.
0 commit comments