From f8b74203b7457fbf0482ec9e10266b370b1bfeab Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 26 Sep 2020 23:07:24 +0200 Subject: compile scss at build time --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 22d5f6a..2886a2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -388,12 +388,9 @@ async fn favicon() -> impl Responder { .message_body(logo.into()) } -lazy_static::lazy_static! { - static ref CSS_TEXT: String = grass::from_string(include_str!("../data/style.scss").to_string(), &grass::Options::default()).unwrap(); -} - async fn css() -> impl Responder { + let css = include_str!(concat!(env!("OUT_DIR"), "/style.css")); web::HttpResponse::Ok() .set(ContentType(mime::TEXT_CSS)) - .body(&*CSS_TEXT) + .message_body(css.into()) } -- cgit v1.2.3