BOOK_STYLE_FILE for multiline css from .env

This commit is contained in:
Lewis Wynne 2026-04-09 17:14:35 +01:00
parent b041941a4a
commit 23fe147861
3 changed files with 17 additions and 1 deletions

View file

@ -72,7 +72,14 @@ impl Config {
std::fs::read_to_string(&path)
.unwrap_or_else(|e| panic!("failed to read template {path}: {e}"))
}),
style: env::var("BOOK_STYLE").unwrap_or_default(),
style: env::var("BOOK_STYLE_FILE")
.ok()
.map(|path| {
std::fs::read_to_string(&path)
.unwrap_or_else(|e| panic!("failed to read style file {path}: {e}"))
})
.or_else(|| env::var("BOOK_STYLE").ok())
.unwrap_or_default(),
form_prompt: env::var("BOOK_FORM_PROMPT")
.unwrap_or_else(|_| "If you visited my site, please sign my guestbook!".into()),
button_text: env::var("BOOK_BUTTON_TEXT")