From ec1f80416bd23bd9fde0866d3c308a56d569672d Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 7 Jan 2021 20:07:43 +0100 Subject: [PATCH] Make chapters sections to avoid rendering them Instead of redirecting the chapter pages to a 404 site. --- blog/content/edition-3/chapters/_index.md | 2 -- .../chapters/{bare-bones.md => bare-bones/_index.md} | 1 + .../chapters/{basic-i-o.md => basic-i-o/_index.md} | 1 + blog/templates/edition-3/index.html | 6 +++--- blog/templates/redirect-to-404.html | 7 ------- 5 files changed, 5 insertions(+), 12 deletions(-) rename blog/content/edition-3/chapters/{bare-bones.md => bare-bones/_index.md} (96%) rename blog/content/edition-3/chapters/{basic-i-o.md => basic-i-o/_index.md} (94%) delete mode 100644 blog/templates/redirect-to-404.html diff --git a/blog/content/edition-3/chapters/_index.md b/blog/content/edition-3/chapters/_index.md index 78b806c3..dcf03563 100644 --- a/blog/content/edition-3/chapters/_index.md +++ b/blog/content/edition-3/chapters/_index.md @@ -1,6 +1,4 @@ +++ title = "Chapters" -insert_anchor_links = "left" render = false -page_template = "redirect-to-404.html" +++ diff --git a/blog/content/edition-3/chapters/bare-bones.md b/blog/content/edition-3/chapters/bare-bones/_index.md similarity index 96% rename from blog/content/edition-3/chapters/bare-bones.md rename to blog/content/edition-3/chapters/bare-bones/_index.md index ec721797..006cf149 100644 --- a/blog/content/edition-3/chapters/bare-bones.md +++ b/blog/content/edition-3/chapters/bare-bones/_index.md @@ -1,5 +1,6 @@ +++ title = "Bare Bones" +render = false +++ In this first chapter, we explain how to create an operating system for the `x86_64` architecture step for step. Starting from scratch, we first create a minimal Rust executable that doesn't depend on the standard library. We then turn it into a bootable OS kernel by combining it with a bootloader. The resulting disk image can then be launched in the [QEMU](https://www.qemu.org/) emulator or booted on a real machine. diff --git a/blog/content/edition-3/chapters/basic-i-o.md b/blog/content/edition-3/chapters/basic-i-o/_index.md similarity index 94% rename from blog/content/edition-3/chapters/basic-i-o.md rename to blog/content/edition-3/chapters/basic-i-o/_index.md index 54b5f2b6..cf8e185e 100644 --- a/blog/content/edition-3/chapters/basic-i-o.md +++ b/blog/content/edition-3/chapters/basic-i-o/_index.md @@ -1,5 +1,6 @@ +++ title = "Basic I/O" +render = false +++ Soluta cum voluptatem fuga reprehenderit tenetur dicta rerum. Ullam minima eaque saepe voluptatum saepe in illum cumque. Debitis doloribus dolores dolores earum minima accusamus eius. Nostrum qui saepe ducimus laudantium temporibus. diff --git a/blog/templates/edition-3/index.html b/blog/templates/edition-3/index.html index 7d25c6fe..4312ea57 100644 --- a/blog/templates/edition-3/index.html +++ b/blog/templates/edition-3/index.html @@ -42,10 +42,10 @@ {% set chapter_slug = chapter | slugify %}
- {% set chapter_page = get_page(path = "edition-3/chapters/" ~ chapter_slug ~ ".md" ) %} -

{{ chapter_page.title }}

+ {% set chapter_section = get_section(path = "edition-3/chapters/" ~ chapter_slug ~ "/_index.md" ) %} +

{{ chapter_section.title }}

- {{ chapter_page.content | safe }} + {{ chapter_section.content | safe }}