From b5bd0296bde934a9d4d412dc5fadcd4502b069ae Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 30 Dec 2020 18:14:17 +0100 Subject: [PATCH] Add icons to posts --- .../posts/01-freestanding-binary/index.md | 4 +++ .../posts/02-minimal-kernel/index.md | 3 ++ blog/sass/css/edition-3/main.scss | 35 +++++++++++++++++-- blog/templates/edition-3/page.html | 7 +++- blog/templates/macros.html | 5 ++- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/blog/content/edition-3/posts/01-freestanding-binary/index.md b/blog/content/edition-3/posts/01-freestanding-binary/index.md index a97b055c..e0711a59 100644 --- a/blog/content/edition-3/posts/01-freestanding-binary/index.md +++ b/blog/content/edition-3/posts/01-freestanding-binary/index.md @@ -6,6 +6,10 @@ date = 0000-01-01 [extra] chapter = "Bare Bones" +icon = ''' + + +''' +++ The first step in creating our own operating system kernel is to create a Rust executable that does not link the standard library. This makes it possible to run Rust code on the [bare metal] without an underlying operating system. diff --git a/blog/content/edition-3/posts/02-minimal-kernel/index.md b/blog/content/edition-3/posts/02-minimal-kernel/index.md index 17cf1927..6eccb32f 100644 --- a/blog/content/edition-3/posts/02-minimal-kernel/index.md +++ b/blog/content/edition-3/posts/02-minimal-kernel/index.md @@ -6,6 +6,9 @@ date = 0000-01-01 [extra] chapter = "Bare Bones" +icon = ''' + +''' +++ In this post we create a minimal 64-bit Rust kernel for the x86 architecture. We build upon the [freestanding Rust binary] from the previous post to create a bootable disk image, that prints something to the screen. diff --git a/blog/sass/css/edition-3/main.scss b/blog/sass/css/edition-3/main.scss index 1031ab11..e51fec3e 100644 --- a/blog/sass/css/edition-3/main.scss +++ b/blog/sass/css/edition-3/main.scss @@ -419,14 +419,39 @@ tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th { /* Blog post or page title */ -.page-title, .post-title, .post-title a { +.page-title, .post-list-title, .post-list-title a { color: var(--post-title-color); } -.page-title, .post-title { +.page-title, .post-list-title { margin-top: 0; } +.post-list-icon { + float: left; + margin-top: -2.1rem; + margin-left: -3rem; + width: 2rem; +} + +.post-title { + margin-bottom: 0.5rem; +} + +.post-title h1 { + display: inline; +} + +.post-icon { + display: inline-block; + padding-top: 0rem; + margin-left: 1rem; + margin-top: -2rem; + margin-bottom: -2rem; + width: 3rem; + vertical-align: -1rem; +} + /* Meta data line below post title */ .post-date { @@ -586,7 +611,11 @@ main img { } .posts ul { - padding-left: 2em; + padding-left: 3rem; +} + +.posts li { + list-style-type: none; } .posts.neutral { diff --git a/blog/templates/edition-3/page.html b/blog/templates/edition-3/page.html index c257ba72..35cd91be 100644 --- a/blog/templates/edition-3/page.html +++ b/blog/templates/edition-3/page.html @@ -34,7 +34,12 @@ {% block main %}
-

{{ page.title }}

+
+

{{ page.title }}

+ + {%- if page.extra.icon -%}{{page.extra.icon | safe}}{%- endif -%} + +