From 38d93a66ba3adb50769704e6f7dc56fe7e6badf9 Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Mon, 1 Jul 2024 03:16:17 +0300 Subject: [PATCH] add color to index --- src/app.rs | 2 ++ templates/index.html | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 0577674..913687a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -34,6 +34,7 @@ struct IndexTemplate<'a> { rss: bool, df: &'a DateFormat, js: bool, + color: Option<&'a str>, } #[derive(Template)] @@ -70,6 +71,7 @@ async fn index<'a>( rss: config.rss.enable, df: &config.date_format, js: config.js_enable, + color: config.default_color.as_deref(), } .into_response()) } diff --git a/templates/index.html b/templates/index.html index 7e6291a..85d6b21 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,11 +7,16 @@ + {% match color %} {% when Some with (color) %} + + {% when None %} {% endmatch %} {{ title }} {% if rss %} - {% endif %} {% if js %} + {% endif %} + + {% if js %} {% endif %}