From decab05a85ea33eeffe75b6275678463277576b6 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Fri, 6 Sep 2024 20:29:24 +0200 Subject: added quote rendering with warko --- assets/css/blog.css | 28 ++++++++++++++++++++++++++++ modules/blogpost_processor.py | 4 +++- modules/warko | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/assets/css/blog.css b/assets/css/blog.css index de80799..8928235 100644 --- a/assets/css/blog.css +++ b/assets/css/blog.css @@ -74,6 +74,34 @@ hr { word-wrap: break-word; } +.quote { + display: flex; + flex-flow: row; + align-items: center; + margin: 1.2rem 0rem; + gap: 1rem; +} + +.quote p { + margin-top: 0rem; + margin-bottom: 0rem; + color: var(--term-yellow); +} + +.quote p:first-child{ + margin-left: auto; + font-size: 2rem; +} + +.quote p:last-child{ + margin-right: auto; + font-size: 2rem; +} + +.quote p:not(:first-child):not(:last-child) { + font-style: italic; +} + .code-block, .code-block-wrap { border-style: solid; diff --git a/modules/blogpost_processor.py b/modules/blogpost_processor.py index b29d91c..a8833e2 100644 --- a/modules/blogpost_processor.py +++ b/modules/blogpost_processor.py @@ -13,6 +13,7 @@ from .warko.strikethrough import StrikeThrough from .warko.headinginjector import get_heading_injector from .warko.extendedimage import get_image_renderer, ExtendedImageElement from .warko.newtablink import get_new_tab_links +from .warko.quote import Quote from ..config import Config CONTENT_FILE_NAME = "content.md" @@ -30,7 +31,7 @@ INTRO_MAX_EXTRA_LENGTH = 100 posts_cache = [] -def get_posts_from_cache() -> list('Post'): +def get_posts_from_cache() -> list['Post']: if len(posts_cache) == 0: raise Exception("Getting posts list from cache while it is still empty.") @@ -44,6 +45,7 @@ class Post: , get_heading_injector("> ") , get_image_renderer(["blog.wazul.moe"]) , get_new_tab_links(["blog.wazul.moe"]) + , Quote ] ) diff --git a/modules/warko b/modules/warko index ed0aa13..9ceea40 160000 --- a/modules/warko +++ b/modules/warko @@ -1 +1 @@ -Subproject commit ed0aa1323a7acae363c670cc1dd6611c09e0c3fb +Subproject commit 9ceea408679913000039013f3a1ddfb695880e6a -- cgit v1.2.3-70-g09d2