Mejora gestión de archivos estáticos en el binario

This commit is contained in:
Manuel Cillero 2022-08-05 00:05:26 +02:00
parent c0a269f009
commit 9997a6b0b1
14 changed files with 163 additions and 72 deletions

View file

@ -1,17 +1,5 @@
use static_files::resource_dir;
use std::env;
use std::path::Path;
use pagetop::util::bundle_resources;
fn main() -> std::io::Result<()> {
build_resource_dir("./static", "mdbook")
}
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(format!("{}.rs", name)),
);
resource.with_module_name(format!("resources_{}", name));
resource.build()
bundle_resources("./static", "mdbook", None)
}