From b932add15d89ab854935cd15930c57b3616ea020 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Thu, 17 Aug 2023 17:29:45 +0800 Subject: templates: support conditional code-highlighting --- sass/_partial/_dark.scss | 3 +-- sass/_partial/_post.scss | 3 +-- templates/base.html | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sass/_partial/_dark.scss b/sass/_partial/_dark.scss index 8789275..ab778df 100644 --- a/sass/_partial/_dark.scss +++ b/sass/_partial/_dark.scss @@ -32,7 +32,6 @@ body { .post { border-color: #616161; code, pre { - background-color: black; color: white; } .highlight { @@ -54,4 +53,4 @@ body { .archive .post-archive .post-item .post-title { color: white; -} \ No newline at end of file +} diff --git a/sass/_partial/_post.scss b/sass/_partial/_post.scss index e1f9c60..b96aad5 100644 --- a/sass/_partial/_post.scss +++ b/sass/_partial/_post.scss @@ -33,7 +33,6 @@ } code, pre { font-size: 16px; - background-color: #f7f7f7; font-family: 'Fantasque Sans Mono', 'PT Mono', 'Source Code Pro', monospace; } .highlight { @@ -180,4 +179,4 @@ .post-meta { color: black; } -} \ No newline at end of file +} diff --git a/templates/base.html b/templates/base.html index 793efad..795adb3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -33,9 +33,20 @@ {% if config.extra.seje_darkmode == "auto" %} + {% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %} + + + {% endif %} {% elif config.extra.seje_darkmode == "always" %} + {% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %} + + {% endif %} + {% else %} + {% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %} + + {% endif %} {% endif %} {% if config.extra.seje_vertical_layout %} -- cgit v1.2.3