From 253042417ad4542cd54de819c14368f38f672a45 Mon Sep 17 00:00:00 2001 From: sunfei Date: Wed, 24 Jan 2024 16:46:52 +0800 Subject: [PATCH] chore: rename practice.rs to practice.course.rs --- en/assets/CNAME | 2 +- en/assets/lang.js | 26 ------------------------ en/assets/lang1.js | 35 ++++++++++++++++++++++++++++++++ en/book.toml | 4 ++-- zh-CN/assets/CNAME | 2 +- zh-CN/assets/lang.js | 26 ------------------------ zh-CN/assets/lang1.js | 35 ++++++++++++++++++++++++++++++++ zh-CN/book.toml | 4 ++-- zh-CN/src/collections/hashmap.md | 2 +- 9 files changed, 77 insertions(+), 59 deletions(-) delete mode 100644 en/assets/lang.js create mode 100644 en/assets/lang1.js delete mode 100644 zh-CN/assets/lang.js create mode 100644 zh-CN/assets/lang1.js diff --git a/en/assets/CNAME b/en/assets/CNAME index c6cd02a..085168d 100644 --- a/en/assets/CNAME +++ b/en/assets/CNAME @@ -1 +1 @@ -practice.rs \ No newline at end of file +practice.course.rs \ No newline at end of file diff --git a/en/assets/lang.js b/en/assets/lang.js deleted file mode 100644 index 061d375..0000000 --- a/en/assets/lang.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - var path = window.location.pathname; - var link = "https://practice.rs" + path; - var word = "English"; - var lang = "zh-CN"; - var changeLang = "切换到英语"; - - if (window.location.href.indexOf("zh.") == -1) { - link = "https://zh.practice.rs" + path; - word = "简体中文"; - lang = "en"; - changeLang = "Switch to Chinese" - } - - var lang_node = ''; - if (link != '') { - lang_node = ' ' + word + ''; - } - - console.log(lang_node) - var insertNode = document.getElementsByClassName('right-buttons'); - if (insertNode.length > 0) { - var html = insertNode[0].innerHTML; - insertNode[0].innerHTML = html + lang_node; - } - })() \ No newline at end of file diff --git a/en/assets/lang1.js b/en/assets/lang1.js new file mode 100644 index 0000000..adf2b00 --- /dev/null +++ b/en/assets/lang1.js @@ -0,0 +1,35 @@ +(function () { + var path = window.location.pathname; + var link = "https://practice.course.rs" + path; + var word = "English"; + var lang = "zh-CN"; + var changeLang = "切换到英语"; + + if (window.location.href.indexOf("zh.") == -1) { + link = "https://practice-zh.course.rs" + path; + word = "简体中文"; + lang = "en"; + changeLang = "Switch to Chinese"; + } + + var lang_node = ""; + if (link != "") { + lang_node = + ' ' + + word + + ""; + } + + console.log(lang_node); + var insertNode = document.getElementsByClassName("right-buttons"); + if (insertNode.length > 0) { + var html = insertNode[0].innerHTML; + insertNode[0].innerHTML = html + lang_node; + } +})(); diff --git a/en/book.toml b/en/book.toml index eae6c2c..abe5695 100644 --- a/en/book.toml +++ b/en/book.toml @@ -14,9 +14,9 @@ level = 1 [output.html] additional-css = ["theme/style1.css"] -additional-js = ["assets/custom3.js","assets/lang.js"] +additional-js = ["assets/custom3.js", "assets/lang1.js"] git-repository-url = "https://github.com/sunface/rust-by-practice" edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/en/{path}" [rust] -edition = "2021" \ No newline at end of file +edition = "2021" diff --git a/zh-CN/assets/CNAME b/zh-CN/assets/CNAME index ffc44bc..89e2aa2 100644 --- a/zh-CN/assets/CNAME +++ b/zh-CN/assets/CNAME @@ -1 +1 @@ -zh.practice.rs \ No newline at end of file +practice-zh.course.rs \ No newline at end of file diff --git a/zh-CN/assets/lang.js b/zh-CN/assets/lang.js deleted file mode 100644 index 061d375..0000000 --- a/zh-CN/assets/lang.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - var path = window.location.pathname; - var link = "https://practice.rs" + path; - var word = "English"; - var lang = "zh-CN"; - var changeLang = "切换到英语"; - - if (window.location.href.indexOf("zh.") == -1) { - link = "https://zh.practice.rs" + path; - word = "简体中文"; - lang = "en"; - changeLang = "Switch to Chinese" - } - - var lang_node = ''; - if (link != '') { - lang_node = ' ' + word + ''; - } - - console.log(lang_node) - var insertNode = document.getElementsByClassName('right-buttons'); - if (insertNode.length > 0) { - var html = insertNode[0].innerHTML; - insertNode[0].innerHTML = html + lang_node; - } - })() \ No newline at end of file diff --git a/zh-CN/assets/lang1.js b/zh-CN/assets/lang1.js new file mode 100644 index 0000000..1f6e8a3 --- /dev/null +++ b/zh-CN/assets/lang1.js @@ -0,0 +1,35 @@ +(function () { + var path = window.location.pathname; + var link = "https://practice.course.rs" + path; + var word = "English"; + var lang = "zh-CN"; + var changeLang = "切换到英语"; + + if (window.location.href.indexOf("zh.") == -1) { + link = "https://practice-zh.practice.rs" + path; + word = "简体中文"; + lang = "en"; + changeLang = "Switch to Chinese"; + } + + var lang_node = ""; + if (link != "") { + lang_node = + ' ' + + word + + ""; + } + + console.log(lang_node); + var insertNode = document.getElementsByClassName("right-buttons"); + if (insertNode.length > 0) { + var html = insertNode[0].innerHTML; + insertNode[0].innerHTML = html + lang_node; + } +})(); diff --git a/zh-CN/book.toml b/zh-CN/book.toml index 9e3feb1..6ec0e15 100644 --- a/zh-CN/book.toml +++ b/zh-CN/book.toml @@ -14,9 +14,9 @@ level = 1 [output.html] additional-css = ["theme/style1.css"] -additional-js = ["assets/custom3.js","assets/lang.js"] +additional-js = ["assets/custom3.js", "assets/lang1.js"] git-repository-url = "https://github.com/sunface/rust-by-practice" edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/zh-CN/{path}" [rust] -edition = "2021" \ No newline at end of file +edition = "2021" diff --git a/zh-CN/src/collections/hashmap.md b/zh-CN/src/collections/hashmap.md index 296103c..a8523e7 100644 --- a/zh-CN/src/collections/hashmap.md +++ b/zh-CN/src/collections/hashmap.md @@ -149,7 +149,7 @@ fn main() { ### 容量 -关于容量,我们在之前的 [Vector](https://zh.practice.rs/collections/vector.html#容量) 中有详细的介绍,而 `HashMap` 也可以调整容量: 你可以通过 `HashMap::with_capacity(uint)` 使用指定的容量来初始化,或者使用 `HashMap::new()` ,后者会提供一个默认的初始化容量。 +关于容量,我们在之前的 [Vector](https://practice-zh.course.rs/collections/vector.html#容量) 中有详细的介绍,而 `HashMap` 也可以调整容量: 你可以通过 `HashMap::with_capacity(uint)` 使用指定的容量来初始化,或者使用 `HashMap::new()` ,后者会提供一个默认的初始化容量。 #### 示例