From 95cd0323a27bb4b215c9d6d0226b22dba96875f4 Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Sat, 4 May 2024 00:18:40 +0300 Subject: [PATCH 1/2] fix config env var --- src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 6f0ae6a..5afb005 100644 --- a/src/config.rs +++ b/src/config.rs @@ -139,8 +139,11 @@ impl Default for CacheConfig { } pub async fn load() -> Result { - let config_file = env::var(format!("{}_CONFIG", env!("CARGO_BIN_NAME"))) - .unwrap_or(String::from("config.toml")); + let config_file = env::var(format!( + "{}_CONFIG", + env!("CARGO_BIN_NAME").to_uppercase().replace("-", "_") + )) + .unwrap_or(String::from("config.toml")); match tokio::fs::OpenOptions::new() .read(true) .open(&config_file) -- 2.45.2 From c1e1670db3073aa690adefb5168f6346df33b35b Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Sat, 4 May 2024 00:24:29 +0300 Subject: [PATCH 2/2] add note when there are no posts --- templates/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/index.html b/templates/index.html index 4292de8..591c008 100644 --- a/templates/index.html +++ b/templates/index.html @@ -17,6 +17,9 @@

posts

+ {% if posts.is_empty() %} + there are no posts right now. check back later! + {% endif %} {% for post in posts %}
{{ post.title }} -- 2.45.2