diff --git a/Cargo.toml b/Cargo.toml index f26e679..1ef83e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,7 +100,9 @@ opt-level = 'z' name = "portfolio" site-root = "target/site" site-pkg-dir = "pkg" +style-file = "style/main.scss" # Important for Hot Reload to work properly (File must exist) tailwind-input-file = "style/portfolio.css" +watch-additional-files = ["data_src"] assets-dir = "public" site-addr = "127.0.0.1:3000" reload-port = 3001 diff --git a/src/main.rs b/src/main.rs index fb799b0..b735169 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,12 @@ cfg_if! { use leptos_actix::{generate_route_list, LeptosRoutes}; use simple_logger::SimpleLogger; + #[get("/style.css")] + async fn css() -> impl Responder { + actix_files::NamedFile::open_async("./style/output.css").await + } + + #[actix_web::main] async fn main() -> std::io::Result<()> { // Configure logger @@ -38,6 +44,7 @@ cfg_if! { .app_data(web::Data::clone(&data)) // Must panic if data can't be loaded .route("/api/{tail:.*}", leptos_actix::handle_server_fns()) .leptos_routes(leptos_options.to_owned(), routes.to_owned(), || view! { }) + .service(css) .service(Files::new("/", site_root)) .wrap(middleware::Compress::default()) }) diff --git a/style/main.scss b/style/main.scss new file mode 100644 index 0000000..e69de29