Fix interal links and work around errors for #comments links

Zola only checks the markdown source for link targets, so an error occurs if the target is in an template. This is the case for our `#comments` links, so we add a dummy target in a comment.
This commit is contained in:
Philipp Oppermann
2022-01-23 16:40:54 +01:00
parent ce51e833a8
commit 0d40ee3750
40 changed files with 59 additions and 19 deletions

View File

@@ -23,6 +23,7 @@ rtl = true
[گیت‌هاب]: https://github.com/phil-opp/blog_os
[در زیر]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->
@@ -457,7 +458,7 @@ rustflags = ["-C", "link-args=-e __start -static -nostartfiles"]
</details>
## خلاصه
## خلاصه {#summary}
یک باینری مستقل مینیمال راست مانند این است:

View File

@@ -22,6 +22,7 @@ Ce blog est développé sur [GitHub]. Si vous avez un problème ou une question,
[GitHub]: https://github.com/phil-opp/blog_os
[en bas de page]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->
@@ -42,7 +43,7 @@ Cela signifie que nous ne pouvons pas utiliser la majeure partie de la [biblioth
[sécurité de la mémoire]: https://tonyarcieri.com/it-s-time-for-a-memory-safety-intervention
Pour créer un noyau d'OS en Rust, nous devons créer un exécutable qui peut tourner sans système d'exploitation sous-jacent. Un tel exécutable est appelé “freestanding” (autoporté) ou “bare-metal”.
Cet article décrit les étapes nécessaires pour créer un exécutable Rust autoporté et explique pourquoi ces étapes sont importantes. Si vous n'êtes intéressé que par un exemple minimal, vous pouvez **[aller au résumé](#résumé)**.
Cet article décrit les étapes nécessaires pour créer un exécutable Rust autoporté et explique pourquoi ces étapes sont importantes. Si vous n'êtes intéressé que par un exemple minimal, vous pouvez **[aller au résumé](#resume)**.
## Désactiver la Bibliothèque Standard

View File

@@ -22,6 +22,7 @@ translators = ["JohnTitor"]
[GitHub]: https://github.com/phil-opp/blog_os
[comments]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->
@@ -45,7 +46,7 @@ OS カーネルを書くためには、いかなる OS の機能にも依存し
Rust で OS カーネルを書くには、基盤となる OS なしで動く実行環境をつくる必要があります。そのような実行環境はフリースタンディング環境やベアメタルのように呼ばれます。
この記事では、フリースタンディングな Rust のバイナリをつくるために必要なステップを紹介し、なぜそれが必要なのかを説明します。もし最小限の説明だけを読みたいのであれば **[概要](#概要)** まで飛ばしてください。
この記事では、フリースタンディングな Rust のバイナリをつくるために必要なステップを紹介し、なぜそれが必要なのかを説明します。もし最小限の説明だけを読みたいのであれば **[概要](#summary)** まで飛ばしてください。
## 標準ライブラリの無効化
@@ -462,7 +463,7 @@ rustflags = ["-C", "link-args=-e __start -static -nostartfiles"]
</details>
## 概要
## 概要 {#summary}
最小限の独立した Rust バイナリは次のようになります:

View File

@@ -18,6 +18,7 @@ This blog is openly developed on [GitHub]. If you have any problems or questions
[GitHub]: https://github.com/phil-opp/blog_os
[at the bottom]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->

View File

@@ -19,6 +19,7 @@ translators = ["MrZloHex"]
[GitHub]: https://github.com/phil-opp/blog_os
[at the bottom]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->
@@ -43,7 +44,7 @@ translators = ["MrZloHex"]
Чтобы создать ядро ОС на Rust, нужно создать исполняемый файл, который мог бы запускаться без ОС.
Этот пост описывает необходимые шаги для создания независимого исполняемого файла на Rust и объясняет, почему эти шаги нужны. Если вам интересен только минимальный пример, можете сразу перейти к __[итогам](#Итоги)__.
Этот пост описывает необходимые шаги для создания независимого исполняемого файла на Rust и объясняет, почему эти шаги нужны. Если вам интересен только минимальный пример, можете сразу перейти к __[итогам](#summary)__.
## Отключение стандартной библиотеки
По умолчанию, все Rust-крейты подключают [стандартную библиотеку][standard library], которая зависит от возможностей операционной системы, таких как потоки, файлы, сети. Она также зависит от стандартной библиотки C `libc`, которая очень тесно взаимодействует с возможностями ОС. Так как мы хотим написать операционную систему, мы не можем использовать библиотеки, которые зависят от операционной системы. Поэтому необходимо отключить автоматические подключение стандартной библиотеки через [атрибут `no_std`][attribute].
@@ -453,7 +454,7 @@ rustflags = ["-C", "link-args=-e __start -static -nostartfiles"]
</details>
## Итоги
## Итоги {#summary}
Минимальный независимый исполняемый бинарный файл Rust выглядит примерно так:

View File

@@ -21,6 +21,7 @@ translators = ["luojia65", "Rustin-Liu", "TheBegining"]
[GitHub]: https://github.com/phil-opp/blog_os
[at the bottom]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->

View File

@@ -21,6 +21,7 @@ translators = ["wusyong"]
[GitHub]: https://github.com/phil-opp/blog_os
[at the bottom]: #comments
<!-- fix for zola anchor checker (target is in template): <a id="comments"> -->
[post branch]: https://github.com/phil-opp/blog_os/tree/post-01
<!-- toc -->
@@ -43,7 +44,7 @@ translators = ["wusyong"]
為了在 Rust 中建立 OS 核心我們需要建立一個無須底層作業系統即可運行的執行檔這類的執行檔通常稱為「獨立式freestanding」或「裸機bare-metal」的執行檔。
這篇文章描述了建立一個獨立的 Rust 執行檔的必要步驟,並解釋為什麼需要這些步驟。如果您只對簡單的範例感興趣,可以直接跳到 **[總結](#總結)**。
這篇文章描述了建立一個獨立的 Rust 執行檔的必要步驟,並解釋為什麼需要這些步驟。如果您只對簡單的範例感興趣,可以直接跳到 **[總結](#summary)**。
## 停用標準函式庫
@@ -450,7 +451,7 @@ rustflags = ["-C", "link-args=-e __start -static -nostartfiles"]
</details>
## 總結
## 總結 {#summary}
一個最小的 Rust 獨立執行檔會看起來像這樣:
@@ -516,4 +517,4 @@ cargo rustc -- -C link-args="-e __start -static -nostartfiles"
[下一篇文章][next post] 將會講解如何將我們的獨立執行檔轉成最小的作業系統核心。這包含建立自訂目標、用啟動程式組合我們的執行檔,還有學習如何輸出一些東西到螢幕上。
[next post]: @/edition-2/posts/02-minimal-rust-kernel/index.md
[next post]: @/edition-2/posts/02-minimal-rust-kernel/index.md