Skip to content

Commit

Permalink
Html UI 本地化。英文版搜索改为 and 逻辑 (#46)
Browse files Browse the repository at this point in the history
* 翻新 README.md

* 添加中英文语言切换功能

* Html UI 本地化。英文版搜索改为 and 逻辑。
  • Loading branch information
Sunshine40 authored Jun 13, 2024
1 parent 33fc927 commit a36a9b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

mdbook build "$@"
MDBOOK_OUTPUT__HTML__THEME=../theme MDBOOK_OUTPUT__HTML__ADDITIONAL_CSS='["../theme/nomicon.css", "../theme/language-picker.css"]' mdbook build en -d ../book/en
MDBOOK_OUTPUT__HTML__THEME=../theme MDBOOK_OUTPUT__HTML__ADDITIONAL_CSS='["../theme/nomicon.css", "../theme/language-picker.css"]' MDBOOK_OUTPUT__HTML__SEARCH__USE_BOOLEAN_AND=true mdbook build en -d ../book/en
20 changes: 10 additions & 10 deletions theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="展开/收起目录" aria-label="展开/收起目录" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<button id="theme-toggle" class="icon-button" type="button" title="更换主题" aria-label="更换主题" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
Expand All @@ -160,7 +160,7 @@
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
{{#if search_enabled}}
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<button id="search-toggle" class="icon-button" type="button" title="全书搜索 (快捷键: s)" aria-label="显示/隐藏搜索框" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
{{/if}}
Expand Down Expand Up @@ -272,17 +272,17 @@
}
</script>
{{#if print_enable}}
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
<a href="{{ path_to_root }}print.html" title="打印本书" aria-label="打印本书">
<i id="print-button" class="fa fa-print"></i>
</a>
{{/if}}
{{#if git_repository_url}}
<a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
<a href="{{git_repository_url}}" title="Git repo" aria-label="Git repo">
<i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
</a>
{{/if}}
{{#if git_repository_edit_url}}
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
<a href="{{git_repository_edit_url}}" title="提出修改建议" aria-label="提出修改建议">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>
{{/if}}
Expand Down Expand Up @@ -320,13 +320,13 @@
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
{{#previous}}
<a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="上一章" aria-label="上一章" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
{{/previous}}

{{#next}}
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="下一章" aria-label="下一章" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
{{/next}}
Expand All @@ -338,13 +338,13 @@

<nav class="nav-wide-wrapper" aria-label="Page navigation">
{{#previous}}
<a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="上一章" aria-label="上一章" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
{{/previous}}

{{#next}}
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="下一章" aria-label="下一章" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
{{/next}}
Expand Down

0 comments on commit a36a9b8

Please sign in to comment.