Skip to content

Commit 2530424

Browse files
author
sunfei
committed
chore: rename practice.rs to practice.course.rs
1 parent 38801fa commit 2530424

File tree

9 files changed

+77
-59
lines changed

9 files changed

+77
-59
lines changed

en/assets/CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
practice.rs
1+
practice.course.rs

en/assets/lang.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

en/assets/lang1.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
})();

en/book.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ level = 1
1414

1515
[output.html]
1616
additional-css = ["theme/style1.css"]
17-
additional-js = ["assets/custom3.js","assets/lang.js"]
17+
additional-js = ["assets/custom3.js", "assets/lang1.js"]
1818
git-repository-url = "https://github.com/sunface/rust-by-practice"
1919
edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/en/{path}"
2020

2121
[rust]
22-
edition = "2021"
22+
edition = "2021"

zh-CN/assets/CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
zh.practice.rs
1+
practice-zh.course.rs

zh-CN/assets/lang.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

zh-CN/assets/lang1.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
})();

zh-CN/book.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ level = 1
1414

1515
[output.html]
1616
additional-css = ["theme/style1.css"]
17-
additional-js = ["assets/custom3.js","assets/lang.js"]
17+
additional-js = ["assets/custom3.js", "assets/lang1.js"]
1818
git-repository-url = "https://github.com/sunface/rust-by-practice"
1919
edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/zh-CN/{path}"
2020

2121
[rust]
22-
edition = "2021"
22+
edition = "2021"

zh-CN/src/collections/hashmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn main() {
149149

150150
### 容量
151151

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()` ,后者会提供一个默认的初始化容量。
153153

154154
#### 示例
155155

0 commit comments

Comments
 (0)