From e6ab935ce2e93c6b9629b8f5a8abc8ff803bd528 Mon Sep 17 00:00:00 2001 From: Phosphorus Date: Fri, 15 Mar 2024 01:59:53 -0300 Subject: [PATCH 1/3] build: migrate to our fork of mdbook --- .github/workflows/main.yml | 4 ++-- .github/workflows/mdbook.yml | 2 +- README.md | 15 ++++++++------- book.toml | 2 ++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7c573ebb..2ced0c51f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/RustLangES/mdBook/releases/download/v0.4.36-localization-v0.2/mdbook-v0.4.36-localization-v0.2-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin curl -sSL https://github.com/catppuccin/mdBook/releases/download/v0.1.1/mdbook-catppuccin-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "$(pwd)/bin" >> ${GITHUB_PATH} - name: Report versions @@ -42,7 +42,7 @@ jobs: - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/RustLangES/mdBook/releases/download/v0.4.36-localization-v0.2/mdbook-v0.4.36-localization-v0.2-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "$(pwd)/bin" >> ${GITHUB_PATH} - name: Install aspell run: sudo apt-get install aspell aspell-es aspell-en diff --git a/.github/workflows/mdbook.yml b/.github/workflows/mdbook.yml index 28ff3c23d..e362f1fa5 100644 --- a/.github/workflows/mdbook.yml +++ b/.github/workflows/mdbook.yml @@ -33,7 +33,7 @@ jobs: - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/RustLangES/mdBook/releases/download/v0.4.36-localization-v0.2/mdbook-v0.4.36-localization-v0.2-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin curl -sSL https://github.com/catppuccin/mdBook/releases/download/v0.1.1/mdbook-catppuccin-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "$(pwd)/bin" >> ${GITHUB_PATH} - name: Setup Pages diff --git a/README.md b/README.md index a1a5f9900..a2a969502 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,19 @@ [![Telegram Group ](https://img.shields.io/badge/Telegram-Group-blue.svg?logo=telegram)]( https://t.me/rust_book_spanish_translation) +[![Discord](https://img.shields.io/discord/778674594856960012?color=blue&label=discord&logo=discord)](https://discord.gg/4ng5HgmaMg) + This repository contains the source of "The Rust Programming Language" book. -This is unofficial Spanish translation of the book. The original book is +This is an unofficial Spanish translation of the book. The original book is available in [rust-lang/book]. We do a best effort approach to keep this translation up to date with the original book, but we can't guarantee that it is 100% accurate. If you find any errors, please open an issue or a pull request or write us in the -[Telegram Group](https://t.me/rust_book_spanish_translation). +[Telegram Group](https://t.me/rust_book_spanish_translation) or our +[Discord Server](https://discord.gg/4ng5HgmaMg) [rust-lang/book]: https://doc.rust-lang.org/stable/book/ @@ -37,14 +40,12 @@ See the [releases] to download just the code of all the code listings that appea ## Requirements -Building the book requires [mdBook], ideally the same version that -rust-lang/rust uses in [this file][rust-mdbook]. To get it: +Building the book requires a custom fork of [mdBook]: -[mdBook]: https://github.com/rust-lang-nursery/mdBook -[rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml +[mdBook]: https://github.com/RustLangES/mdBook/ ```bash -$ cargo install mdbook --version +$ cargo install mdbook --git https://github.com/RustLangES/mdBook.git ``` ## Building diff --git a/book.toml b/book.toml index 8d64e3a81..d7ab96a66 100644 --- a/book.toml +++ b/book.toml @@ -2,6 +2,8 @@ title = "El Lenguaje de Programación Rust" authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"] description = "El libro oficial para aprender el lenguaje de programación Rust, con tutoriales y guías." +src = "src" +multilingual = false language = "es" [output.html] From 8b6adacaef4ba81c20ff32a5e48891fea03249fa Mon Sep 17 00:00:00 2001 From: Phosphorus Date: Fri, 15 Mar 2024 02:00:07 -0300 Subject: [PATCH 2/3] feat: use the slug to add a canonical url --- theme/index.hbs | 122 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 36 deletions(-) diff --git a/theme/index.hbs b/theme/index.hbs index acb848117..0b0932948 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -15,6 +15,13 @@ {{> head}} + {{#if (eq slug "title-page") }} + + {{else}} + + {{/if}} + + @@ -60,15 +67,16 @@ {{/if}} - + +
- - - + + - + + +
{{> header}} -