File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,20 @@ $(document).ready(function() {
18
18
warningBox . hidden = false ;
19
19
}
20
20
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 ( ) {
22
27
$ ( this ) . attr (
23
28
'href' ,
24
29
$ ( this )
25
30
. attr ( 'href' )
26
- . replace ( 'master/docs/' , branchName + '/docs /' ) ,
31
+ . replace ( / \/ e n \/ [ ^ \/ ] + \/ / , '/en/' + branchName + '/' ) ,
27
32
) ;
28
33
} ) ;
29
34
30
- if ( ! / ^ \d + \. \d + $ / . test ( branchName ) && branchName !== 'latest' ) {
31
- branchName = 'master' ;
32
- }
33
-
34
35
// Add version pill to top of navigation
35
36
$ ( '#site-name' ) . append ( '<span class="pill">' + branchName + '</span>' ) ;
36
37
Original file line number Diff line number Diff line change 19
19
< div class ="main_nav ">
20
20
< div class ="main_nav_content ">
21
21
< 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 >
23
27
</ div >
24
28
< div class ="md-sidebar md-sidebar--primary " data-md-component ="navigation ">
25
29
< div class ="md-sidebar__scrollwrap ">
You can’t perform that action at this time.
0 commit comments