mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-04 09:49:46 +02:00
Update to new version
This commit is contained in:
parent
4cd4269b8d
commit
41a6f35fa3
@ -95,7 +95,4 @@ optional = true
|
||||
"pt-BR" = "Brazilian Portuguese (Português do Brasil)"
|
||||
|
||||
[output.tera-backend]
|
||||
html_components = [
|
||||
"src/components/LanguagePicker.html",
|
||||
]
|
||||
templates_dir = "src/components"
|
||||
template_dir = "src/components"
|
@ -1,20 +1,20 @@
|
||||
{% import "macros.html" as macros %}
|
||||
{% set current_language = ctx | get(key="config") | get(key="book") | get(key="language", default="en") %}
|
||||
<button id="language-toggle{{ counter }}" class="icon-button" type="button"
|
||||
{% set current_language = ctx.config.book.language %}
|
||||
<button id="language-toggle" class="icon-button" type="button"
|
||||
title="Change language" aria-label="Change language"
|
||||
aria-haspopup="true" aria-expanded="false"
|
||||
aria-controls="language-list{{ counter }}" style="{{ attributes | get(key="style", default="") }}">
|
||||
aria-controls="language-list">
|
||||
<i class="fa fa-globe"></i>
|
||||
</button>
|
||||
<ul id="language-list{{ counter }}" class="theme-popup" aria-label="Languages"
|
||||
role="menu" style="left: auto; right: 10px;">
|
||||
{% for identifier, language_name in get_context(key="output.i18n.languages") %}
|
||||
<ul id="language-list" class="theme-popup" aria-label="Languages"
|
||||
role="menu" style="left: auto; right: 10px; display: none;">
|
||||
{% for identifier, language_name in ctx.config.output.i18n.languages %}
|
||||
<li role="none">
|
||||
<a id="{{ identifier }}"
|
||||
href="{{ macros::get_rendered_path(identifier=identifier) }}"
|
||||
style="color: inherit;">
|
||||
<button role="menuitem" class="theme {% if identifier == current_language %} theme-selected {% endif %}">
|
||||
{% include "include_language_picker.html" %} {{ language_name }}
|
||||
{{ language_name }}
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
@ -22,8 +22,8 @@
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
let langToggle = document.getElementById("language-toggle{{ counter }}");
|
||||
let langList = document.getElementById("language-list{{ counter }}");
|
||||
let langToggle = document.getElementById("language-toggle");
|
||||
let langList = document.getElementById("language-list");
|
||||
{% raw %}
|
||||
langToggle.addEventListener("click", (event) => {
|
||||
langList.style.display = langList.style.display == "block" ? "none" : "block";
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
<style>
|
||||
[dir=rtl] #language-list{{ counter }} {% raw %} {
|
||||
[dir=rtl] #language-list {% raw %} {
|
||||
left: 10px;
|
||||
right: auto;
|
||||
}
|
||||
|
@ -4,13 +4,6 @@
|
||||
[](https://github.com/google/comprehensive-rust/graphs/contributors)
|
||||
[](https://github.com/google/comprehensive-rust/stargazers)
|
||||
|
||||
<LanguagePicker>
|
||||
</LanguagePicker>
|
||||
<LanguagePicker style="color: red;">
|
||||
</LanguagePicker>
|
||||
<LanguagePicker style="color: yellow;">
|
||||
</LanguagePicker>
|
||||
|
||||
This is a free Rust course developed by the Android team at Google. The course covers
|
||||
the full spectrum of Rust, from basic syntax to advanced topics like generics
|
||||
and error handling.
|
||||
|
@ -8,6 +8,7 @@
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-ZN78TEJMRW');
|
||||
</script>
|
||||
|
||||
{{! Move to template code after fixing this issue:
|
||||
https://github.com/google/mdbook-i18n-helpers/issues/70 }}
|
||||
<script>
|
||||
|
@ -168,10 +168,8 @@
|
||||
<div class="right-buttons">
|
||||
{{{{raw}}}}
|
||||
{% set current_language = ctx | get(key="config") | get(key="book") | get(key="language", default="en") %}
|
||||
CURRENT LANGUAGE: {{ current_language }}
|
||||
{% include "LanguagePicker.html" %}
|
||||
{{{{/raw}}}}
|
||||
<LanguagePicker style="color: red;">
|
||||
</LanguagePicker>
|
||||
{{#if print_enable}}
|
||||
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
|
||||
<i id="print-button" class="fa fa-print"></i>
|
||||
|
Loading…
x
Reference in New Issue
Block a user