From 695b73133e1ce462f912656d762d0de4bbed5e47 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 11 Mar 2023 07:04:22 +0000 Subject: feat(response): allow multiple css files --- src/response.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/response.rs b/src/response.rs index 547cf12..393e3b8 100644 --- a/src/response.rs +++ b/src/response.rs @@ -141,10 +141,15 @@ pub async fn default( // Try to add an external stylesheet from the `CSS_EXTERNAL` environment // variable. if let Ok(css) = var("CSS_EXTERNAL") { - html_context.push_str(&format!( - "", - css - )); + let stylesheets = + css.split(',').filter(|s| !s.is_empty()).collect::>(); + + for stylesheet in stylesheets { + html_context.push_str(&format!( + "", + stylesheet, + )); + } } // Try to add an external favicon from the `FAVICON_EXTERNAL` environment -- cgit v1.2.3