File tree Expand file tree Collapse file tree 9 files changed +77
-59
lines changed Expand file tree Collapse file tree 9 files changed +77
-59
lines changed Original file line number Diff line number Diff line change 1
- practice.rs
1
+ practice.course. rs
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ var path = window . location . pathname ;
3
+ var link = "https://practice.course.rs" + path ;
4
+ var word = "English" ;
5
+ var lang = "zh-CN" ;
6
+ var changeLang = "切换到英语" ;
7
+
8
+ if ( window . location . href . indexOf ( "zh." ) == - 1 ) {
9
+ link = "https://practice-zh.course.rs" + path ;
10
+ word = "简体中文" ;
11
+ lang = "en" ;
12
+ changeLang = "Switch to Chinese" ;
13
+ }
14
+
15
+ var lang_node = "" ;
16
+ if ( link != "" ) {
17
+ lang_node =
18
+ '<a href="' +
19
+ link +
20
+ '" title="' +
21
+ changeLang +
22
+ '" aria-label="' +
23
+ changeLang +
24
+ '"><i id="change-language-button" class="fa fa-language"> ' +
25
+ word +
26
+ "</i></a>" ;
27
+ }
28
+
29
+ console . log ( lang_node ) ;
30
+ var insertNode = document . getElementsByClassName ( "right-buttons" ) ;
31
+ if ( insertNode . length > 0 ) {
32
+ var html = insertNode [ 0 ] . innerHTML ;
33
+ insertNode [ 0 ] . innerHTML = html + lang_node ;
34
+ }
35
+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ level = 1
14
14
15
15
[output .html ]
16
16
additional-css = [" theme/style1.css" ]
17
- additional-js = [" assets/custom3.js" ," assets/lang .js" ]
17
+ additional-js = [" assets/custom3.js" , " assets/lang1 .js" ]
18
18
git-repository-url = " https://github.com/sunface/rust-by-practice"
19
19
edit-url-template = " https://github.com/sunface/rust-by-practice/edit/master/en/{path}"
20
20
21
21
[rust ]
22
- edition = " 2021"
22
+ edition = " 2021"
Original file line number Diff line number Diff line change 1
- zh.practice .rs
1
+ practice- zh.course .rs
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ var path = window . location . pathname ;
3
+ var link = "https://practice.course.rs" + path ;
4
+ var word = "English" ;
5
+ var lang = "zh-CN" ;
6
+ var changeLang = "切换到英语" ;
7
+
8
+ if ( window . location . href . indexOf ( "zh." ) == - 1 ) {
9
+ link = "https://practice-zh.practice.rs" + path ;
10
+ word = "简体中文" ;
11
+ lang = "en" ;
12
+ changeLang = "Switch to Chinese" ;
13
+ }
14
+
15
+ var lang_node = "" ;
16
+ if ( link != "" ) {
17
+ lang_node =
18
+ '<a href="' +
19
+ link +
20
+ '" title="' +
21
+ changeLang +
22
+ '" aria-label="' +
23
+ changeLang +
24
+ '"><i id="change-language-button" class="fa fa-language"> ' +
25
+ word +
26
+ "</i></a>" ;
27
+ }
28
+
29
+ console . log ( lang_node ) ;
30
+ var insertNode = document . getElementsByClassName ( "right-buttons" ) ;
31
+ if ( insertNode . length > 0 ) {
32
+ var html = insertNode [ 0 ] . innerHTML ;
33
+ insertNode [ 0 ] . innerHTML = html + lang_node ;
34
+ }
35
+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ level = 1
14
14
15
15
[output .html ]
16
16
additional-css = [" theme/style1.css" ]
17
- additional-js = [" assets/custom3.js" ," assets/lang .js" ]
17
+ additional-js = [" assets/custom3.js" , " assets/lang1 .js" ]
18
18
git-repository-url = " https://github.com/sunface/rust-by-practice"
19
19
edit-url-template = " https://github.com/sunface/rust-by-practice/edit/master/zh-CN/{path}"
20
20
21
21
[rust ]
22
- edition = " 2021"
22
+ edition = " 2021"
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ fn main() {
149
149
150
150
### 容量
151
151
152
- 关于容量,我们在之前的 [ Vector] ( https://zh.practice .rs/collections/vector.html#容量 ) 中有详细的介绍,而 ` HashMap ` 也可以调整容量: 你可以通过 ` HashMap::with_capacity(uint) ` 使用指定的容量来初始化,或者使用 ` HashMap::new() ` ,后者会提供一个默认的初始化容量。
152
+ 关于容量,我们在之前的 [ Vector] ( https://practice- zh.course .rs/collections/vector.html#容量 ) 中有详细的介绍,而 ` HashMap ` 也可以调整容量: 你可以通过 ` HashMap::with_capacity(uint) ` 使用指定的容量来初始化,或者使用 ` HashMap::new() ` ,后者会提供一个默认的初始化容量。
153
153
154
154
#### 示例
155
155
You can’t perform that action at this time.
0 commit comments