From 233dec4cafc7ff9c34d741ab4ed6055eec41952e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 23 Jan 2022 21:32:43 +0100 Subject: [PATCH] Various 3rd edition template improvements - merge improvements from second edition (e.g. improved light switch, prefered theme in session storage, translation support) - giscus instead of utterances - add an alpha warning - fix error caused by missing posts etc --- blog/content/edition-3/_index.md | 18 +++ blog/templates/edition-3/extra.html | 4 +- blog/templates/edition-3/foundation.html | 35 +++--- blog/templates/edition-3/index.html | 59 ++++------ blog/templates/edition-3/macros.html | 138 +++++++++++++---------- blog/templates/edition-3/page.html | 74 ++++++------ 6 files changed, 176 insertions(+), 152 deletions(-) diff --git a/blog/content/edition-3/_index.md b/blog/content/edition-3/_index.md index c8d7a972..f0b8cc40 100644 --- a/blog/content/edition-3/_index.md +++ b/blog/content/edition-3/_index.md @@ -1,3 +1,21 @@ +++ template = "edition-3/index.html" +++ + +

Writing an OS in Rust

+ +

Writing an OS in Rust

+ +

A blog by Philipp Oppermann — Third Edition (Alpha Release)

+ +
+ +This blog series creates a small operating system in the [Rust programming language](https://www.rust-lang.org/). Each post is a small tutorial and includes all needed code, so you can follow along if you like. The source code is also available in the corresponding [Github repository](https://github.com/phil-opp/blog_os). + + + +We explain how to create an operating system for the **`x86_64`** architecture step by step. Starting from scratch, we create a bootable OS kernel, implement basic input/output support, show how to test and debug our kernel, explain virtual memory management, and add support for multitasking and userspace programs. + +Latest post: + +
diff --git a/blog/templates/edition-3/extra.html b/blog/templates/edition-3/extra.html index 849689b4..2af4e504 100644 --- a/blog/templates/edition-3/extra.html +++ b/blog/templates/edition-3/extra.html @@ -16,7 +16,7 @@ {% block after_main %}
-

Comments

- {{ snippets::utterances() }} +

Comments

+ {{ snippets::giscus(search_term=page.title ~ " (Extra Post)") }}
{% endblock after_main %} diff --git a/blog/templates/edition-3/foundation.html b/blog/templates/edition-3/foundation.html index 9a4776cf..4a0cf567 100644 --- a/blog/templates/edition-3/foundation.html +++ b/blog/templates/edition-3/foundation.html @@ -6,6 +6,7 @@ + @@ -16,6 +17,13 @@ + + {% block title %}{% endblock title %} (Third Edition - Alpha) @@ -34,30 +42,19 @@ -
- - - - + diff --git a/blog/templates/edition-3/index.html b/blog/templates/edition-3/index.html index 4312ea57..62084e98 100644 --- a/blog/templates/edition-3/index.html +++ b/blog/templates/edition-3/index.html @@ -6,34 +6,20 @@ {% block title %}{{ config.title }}{% endblock title %} {% block main %} + {% set posts_section = get_section(path = "edition-3/posts/_index.md") %} {% set posts = posts_section.pages %} -

Writing an OS in Rust

-

{{ config.extra.subtitle | replace(from=" ", to=" ") | safe }} — Third Edition (Alpha Release)

- -
-

- This blog series creates a small operating system in the - Rust programming language. Each post is a small tutorial and includes all - needed code, so you can follow along if you like. The source code is also available in the corresponding - Github repository. -

- -

Latest post: - {% set latest_post = posts|last %} - {{ latest_post.title }} -

-
- - +{{ section.content + | replace(from="", to=macros::latest_post(posts=posts)) + | replace(from="", to=macros::alpha_warning()) + | safe +}} {%- set chapter = "none" -%} {%- for post in posts -%} {%- if post.extra["chapter"] != chapter -%} - {%- if chapter != "none" -%} + {%- if not loop.first -%} {%- endif -%} @@ -52,8 +38,11 @@ {%- endif -%}
  • {{ macros::post_link(page=post) }}
  • + + {% if loop.last %} + + {% endif %} {%- endfor -%} -
    @@ -83,10 +72,10 @@

    You are currently viewing the third edition of “Writing an OS in Rust”. In case you are interested in the older editions, you can still find them here:

    Note that the older editions are no longer updated and might no longer work or contain outdated information.

    @@ -100,22 +89,20 @@ {% block after_main %}