From e8addb1d7075bf2e51d82ad43dd5bba14607fd4b Mon Sep 17 00:00:00 2001 From: zaaarf Date: Fri, 19 Jan 2024 18:47:53 +0100 Subject: [PATCH] feat: fine-tuning date format, subtitle in post list --- config.toml | 6 ++++++ sass/_main.scss | 6 +++++- templates/head.html | 4 ++-- templates/post.html | 18 +++++++++++------- templates/section.html | 25 +++++++++++++++++-------- theme.toml | 2 +- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/config.toml b/config.toml index 0e044d8..868e465 100644 --- a/config.toml +++ b/config.toml @@ -62,6 +62,11 @@ header_nav = [ { url = "/blog", name_en = "/blog/", name_fr = "/blog/" } ] +# Enable KaTeX for mathematical typesetting. +# Even if you enable it here, you still have to enable it on a per-page +# basis by setting setting extra.math to true. +enable_katex = false + # Homepage configuration stuff [extra.home] title = "you" @@ -85,6 +90,7 @@ social_icons = [ # Valid keys are "post" and "list", one referring to individual blogposts, # the other referring to lists of posts in sections. # You may set "list" to whitespace(s) to disable displaying dates in sections. +# May be configured on section and page level as well. # Refer to https://docs.rs/chrono/0.4.31/chrono/format/strftime/index.html # for formatting instructions. [extra.date_format] diff --git a/sass/_main.scss b/sass/_main.scss index f0d7eb2..307446c 100644 --- a/sass/_main.scss +++ b/sass/_main.scss @@ -175,7 +175,11 @@ footer { text-align: left; span.content-date { - color: var(--dateLinkColor); + color: var(--darkLinkColor); + } + + span.content-subtitle { + color: var(--darkLinkColor); } } diff --git a/templates/head.html b/templates/head.html index 59d244d..74674eb 100644 --- a/templates/head.html +++ b/templates/head.html @@ -83,7 +83,7 @@ --fgColor: {% if config.extra.colors.dark.foreground_color %}{{ config.extra.colors.dark.foreground_color }}{% else %}#D6D6D6{% endif %}; --metaColor: {% if config.extra.colors.dark.meta_color %}{{ config.extra.colors.dark.meta_color }}{% else %}#78B6AD{% endif %}; --linkColor: {% if config.extra.colors.dark.link_color %}{{ config.extra.colors.dark.link_color }}{% else %}#DBD5BC{% endif %}; - --dateLinkColor: {% if config.extra.colors.dark.date_link_color %}{{ config.extra.colors.dark.date_link_color }}{% else %}#6F6847{% endif %}; + --darkLinkColor: {% if config.extra.colors.dark.dark_link_color %}{{ config.extra.colors.dark.dark_link_color }}{% else %}#6F6847{% endif %}; --codeLineColor: {% if config.extra.colors.dark.code_line_color %}{{ config.extra.colors.dark.code_line_color }}{% else %}#31333d{% endif %}; } @@ -92,7 +92,7 @@ --fgColor: {% if config.extra.colors.light.foreground_color %}{{ config.extra.colors.light.foreground_color }}{% else %}#41474E{% endif %}; --metaColor: {% if config.extra.colors.light.meta_color %}{{ config.extra.colors.light.meta_color }}{% else %}#D26878{% endif %}; --linkColor: {% if config.extra.colors.light.link_color %}{{ config.extra.colors.light.link_color }}{% else %}#5690AF{% endif %}; - --dateLinkColor: {% if config.extra.colors.light.date_link_color %}{{ config.extra.colors.light.date_link_color }}{% else %}#223844{% endif %}; + --darkLinkColor: {% if config.extra.colors.light.dark_link_color %}{{ config.extra.colors.light.dark_link_color }}{% else %}#223844{% endif %}; --codeLineColor: {% if config.extra.colors.light.code_line_color %}{{ config.extra.colors.light.code_line_color }}{% else %}#FFFFFF{% endif %}; } diff --git a/templates/post.html b/templates/post.html index fd45705..ccd4f16 100644 --- a/templates/post.html +++ b/templates/post.html @@ -2,13 +2,17 @@ {% block pre_content %}
../
-{% if config.extra.date_format.post %} - {% set datefmt = config.extra.date_format.post %} -{% else %} - {% set datefmt = "%Y-%m-%dT%H:%M:%S%Z" %} -{% endif %} +{%- if page.extra.date_format.post -%} + {%- set datefmt = page.extra.date_format.post -%} +{%- elif section.extra.date_format.post -%} + {%- set datefmt = section.extra.date_format.post -%} +{%- elif config.extra.date_format.post -%} + {%- set datefmt = config.extra.date_format.post -%} +{%- else -%} + {%- set datefmt = "%Y-%m-%dT%H:%M:%S%Z" -%} +{%- endif -%} -{% if config.extra.author and config.extra.display_author == true %} +{%- if config.extra.author and config.extra.display_author == true -%} -{% endif %} +{%- endif -%} {% endblock pre_content %} diff --git a/templates/section.html b/templates/section.html index 70b2a47..b41d3a9 100644 --- a/templates/section.html +++ b/templates/section.html @@ -12,14 +12,23 @@ {% endif %} {% if paginator %} diff --git a/theme.toml b/theme.toml index bf8f585..7a8f334 100644 --- a/theme.toml +++ b/theme.toml @@ -9,5 +9,5 @@ min_version = "0.4.0" [author] -name = "zaaaerf" +name = "zaaarf" homepage = "https://zaaarf.foo/"