aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-03-11 07:04:22 +0000
committerFuwn <[email protected]>2023-03-11 07:04:22 +0000
commit695b73133e1ce462f912656d762d0de4bbed5e47 (patch)
tree6ba3a2333fc846086ceb745db6bb4a303080e457 /src
parentci(check.yaml): correct rust toolchain (diff)
downloadseptember-695b73133e1ce462f912656d762d0de4bbed5e47.tar.xz
september-695b73133e1ce462f912656d762d0de4bbed5e47.zip
feat(response): allow multiple css files
Diffstat (limited to 'src')
-rw-r--r--src/response.rs13
1 files changed, 9 insertions, 4 deletions
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!(
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"{}\">",
- css
- ));
+ let stylesheets =
+ css.split(',').filter(|s| !s.is_empty()).collect::<Vec<_>>();
+
+ for stylesheet in stylesheets {
+ html_context.push_str(&format!(
+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"{}\">",
+ stylesheet,
+ ));
+ }
}
// Try to add an external favicon from the `FAVICON_EXTERNAL` environment