From 5c3015acc3a061255cf149810badbce7728b9c2b Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Mon, 28 Dec 2020 19:48:47 +0100
Subject: [PATCH] Display posts of chapter as list
---
blog/sass/css/edition-3/main.scss | 4 ++++
blog/templates/edition-3/index.html | 33 +++++++++++++++--------------
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/blog/sass/css/edition-3/main.scss b/blog/sass/css/edition-3/main.scss
index 5e2e0351..ec8e498b 100644
--- a/blog/sass/css/edition-3/main.scss
+++ b/blog/sass/css/edition-3/main.scss
@@ -555,6 +555,10 @@ main img {
margin-right: -0.5rem;
}
+.posts ul {
+ padding-left: 2em;
+}
+
.posts.neutral {
border: 2px solid #999;
}
diff --git a/blog/templates/edition-3/index.html b/blog/templates/edition-3/index.html
index da48181f..4083b8db 100644
--- a/blog/templates/edition-3/index.html
+++ b/blog/templates/edition-3/index.html
@@ -18,7 +18,7 @@
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 }}
@@ -29,27 +29,28 @@
In the following posts, we explain how to create an operating system for the x86_64 architecture step for 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.
-->
-
{%- set chapter = "none" -%}
{%- for post in posts -%}
- {%- if post.extra["chapter"] -%}
- {%- if post.extra["chapter"] != chapter -%}
- {# Begin new chapter #}
- {%- set_global chapter = post.extra["chapter"] -%}
-
-
-{% set chapter_slug = chapter | slugify %}
-
-{% set chapter_page = get_page(path = "edition-3/chapters/" ~ chapter_slug ~ ".md" ) %}
-
{{ chapter_page.title }}
-{{ chapter_page.content | safe }}
-
+ {%- if post.extra["chapter"] != chapter -%}
+ {%- if chapter != "none" -%}
+
{%- endif -%}
+
+ {# Begin new chapter #}
+ {%- set_global chapter = post.extra["chapter"] -%}
+
+ {% set chapter_slug = chapter | slugify %}
+
+ {% set chapter_page = get_page(path = "edition-3/chapters/" ~ chapter_slug ~ ".md" ) %}
+
{{ chapter_page.title }}
+ {{ chapter_page.content | safe }}
+
+
{%- endif -%}
- {{ macros::post_link_edition_3(page=post) }}
+ - {{ macros::post_link_edition_3(page=post) }}
{%- endfor -%}
-
+