diff --git a/drust/Cargo.toml b/drust/Cargo.toml index 4e06320a..983496c2 100644 --- a/drust/Cargo.toml +++ b/drust/Cargo.toml @@ -19,7 +19,7 @@ features = ["mysql"] default-features = false [dependencies] -actix-web = "3.3.3" +actix-web = "4.1.0" pagetop-admin = { path = "../pagetop-admin" } pagetop-user = { path = "../pagetop-user" } pagetop-node = { path = "../pagetop-node" } diff --git a/pagetop-admin/Cargo.toml b/pagetop-admin/Cargo.toml index 1f037317..7eebf18a 100644 --- a/pagetop-admin/Cargo.toml +++ b/pagetop-admin/Cargo.toml @@ -15,4 +15,4 @@ license = "Apache-2.0 or MIT" [dependencies] pagetop = { path = "../pagetop" } -maud = { version = "0.23.0" } +maud = { git = "https://github.com/lambda-fairy/maud", rev = "e6787cd6" } diff --git a/pagetop/Cargo.toml b/pagetop/Cargo.toml index 11fd2d5e..9ca64c7c 100644 --- a/pagetop/Cargo.toml +++ b/pagetop/Cargo.toml @@ -43,11 +43,11 @@ fluent-templates = "0.7.1" unic-langid = "0.9.0" actix-web = "4.1.0" -actix-web-static-files = "4.0.0" actix-files = "0.6.1" +actix-web-static-files = "4.0.0" +static-files = "0.2.3" -maud = { git = "https://github.com/lambda-fairy/maud", rev = "e6787cd62165a075c7f16a32f8bbacc398f52d13", features = ["actix-web"] } -sycamore = { version = "0.7.1", features = ["ssr"] } +maud = { git = "https://github.com/lambda-fairy/maud", rev = "e6787cd6", features = ["actix-web"] } serde = { version = "1.0", features = ["derive"] } diff --git a/pagetop/STARTER.bin.Cargo.toml b/pagetop/STARTER.bin.Cargo.toml index f3169356..4958aea5 100644 --- a/pagetop/STARTER.bin.Cargo.toml +++ b/pagetop/STARTER.bin.Cargo.toml @@ -18,8 +18,8 @@ features = ["mysql"] default-features = false [dependencies] -actix-web = "3.3.3" +actix-web = "4.1.0" # Si se usa la macro html!: -maud = { version = "0.23.0" } +maud = { git = "https://github.com/lambda-fairy/maud", rev = "e6787cd6" } # Si se requiere serialización de estructuras de datos: serde = { version = "1.0", features = ["derive"] } diff --git a/pagetop/STARTER.lib.Cargo.toml b/pagetop/STARTER.lib.Cargo.toml index c268b8cc..7c06a7fd 100644 --- a/pagetop/STARTER.lib.Cargo.toml +++ b/pagetop/STARTER.lib.Cargo.toml @@ -9,6 +9,6 @@ edition = "2021" [dependencies] pagetop = { path = "../pagetop" } # Si se usa la macro html!: -maud = { version = "0.23.0" } +maud = { git = "https://github.com/lambda-fairy/maud", rev = "e6787cd6" } # Si se requiere serialización de estructuras de datos: serde = { version = "1.0", features = ["derive"] } diff --git a/pagetop/build.rs b/pagetop/build.rs index 483b2294..c0b8812e 100644 --- a/pagetop/build.rs +++ b/pagetop/build.rs @@ -3,17 +3,18 @@ use static_files::resource_dir; use std::env; use std::path::Path; -fn main() { - build_resource_dir("./static/theme", "theme.rs", "assets"); - build_resource_dir("./static/aliner", "aliner.rs", "assets"); - build_resource_dir("./static/bootsier", "bootsier.rs", "assets"); +fn main() -> std::io::Result<()> { + build_resource_dir("./static/theme", "theme")?; + build_resource_dir("./static/aliner", "aliner")?; + build_resource_dir("./static/bootsier", "bootsier")?; + build_resource_dir("./static/bulmix", "bulmix") } -fn build_resource_dir(dir: &str, with_filename: &str, with_fn: &str) { +fn build_resource_dir(dir: &str, name: &str) -> std::io::Result<()> { let mut resource = resource_dir(dir); resource.with_generated_filename( - Path::new(env::var("OUT_DIR").unwrap().as_str()).join(with_filename) + Path::new(env::var("OUT_DIR").unwrap().as_str()).join(format!("{}.rs", name)) ); - resource.with_generated_fn(with_fn); - resource.build().unwrap(); + resource.with_module_name(format!("resources_{}", name)); + resource.build() } diff --git a/pagetop/src/app/application.rs b/pagetop/src/app/application.rs index 4cb18d39..6f175555 100644 --- a/pagetop/src/app/application.rs +++ b/pagetop/src/app/application.rs @@ -4,7 +4,6 @@ use crate::core::{module, theme}; use super::AppTrait; use std::io::Error; -use actix_web::middleware::normalize::{NormalizePath, TrailingSlash}; use actix_web::dev::Server; pub struct Application { @@ -52,8 +51,7 @@ impl Application { // Prepara el servidor web. let server = super::HttpServer::new(move || { super::App::new() - .wrap(tracing_actix_web::TracingLogger) - .wrap(NormalizePath::new(TrailingSlash::Trim)) + .wrap(tracing_actix_web::TracingLogger::default()) .configure(&module::all::modules) .configure(&theme::all::themes) }) diff --git a/pagetop/src/base/theme/bootsier.rs b/pagetop/src/base/theme/bootsier.rs index 8512234f..3e875f30 100644 --- a/pagetop/src/base/theme/bootsier.rs +++ b/pagetop/src/base/theme/bootsier.rs @@ -60,7 +60,7 @@ impl ThemeTrait for Bootsier { style="width: 20%; max-width: 188px" alt="Caution!"; div class="media-body" { - h1 class="display-4" { (s) } + h1 class="display-4" { (s.as_str()) } p class="lead" { (l(description)) } hr class="my-4"; p { (l(message)) } diff --git a/pagetop/src/core/theme/definition.rs b/pagetop/src/core/theme/definition.rs index 520eadc4..2b0c5d97 100644 --- a/pagetop/src/core/theme/definition.rs +++ b/pagetop/src/core/theme/definition.rs @@ -127,7 +127,7 @@ pub trait ThemeTrait: BaseTheme + Send + Sync { .with_title(format!("Error {}", s.as_str()).as_str()) .add_to("content", Chunck::with(html! { div { - h1 { (s) } + h1 { (s.as_str()) } } })) .render()