Añade las dependencias para soportar Actix-web 4
Pendiente de que Maud libere una nueva versión con las modificaciones aplicadas en https://github.com/lambda-fairy/maud/pull/331 para soportar Actix-web 4.
This commit is contained in:
parent
1102a76e47
commit
ad65ab494c
3 changed files with 26 additions and 41 deletions
|
|
@ -1,33 +1,19 @@
|
|||
use actix_web_static_files::resource_dir;
|
||||
use static_files::resource_dir;
|
||||
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
resource_dir("./static/theme")
|
||||
.with_generated_filename(
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
||||
.join("theme.rs")
|
||||
)
|
||||
.with_generated_fn("assets")
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
resource_dir("./static/aliner")
|
||||
.with_generated_filename(
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
||||
.join("aliner.rs")
|
||||
)
|
||||
.with_generated_fn("assets")
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
resource_dir("./static/bootsier")
|
||||
.with_generated_filename(
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
||||
.join("bootsier.rs")
|
||||
)
|
||||
.with_generated_fn("assets")
|
||||
.build()
|
||||
.unwrap();
|
||||
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 build_resource_dir(dir: &str, with_filename: &str, with_fn: &str) {
|
||||
let mut resource = resource_dir(dir);
|
||||
resource.with_generated_filename(
|
||||
Path::new(env::var("OUT_DIR").unwrap().as_str()).join(with_filename)
|
||||
);
|
||||
resource.with_generated_fn(with_fn);
|
||||
resource.build().unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue