Mejora gestión de archivos estáticos en el binario
This commit is contained in:
parent
c0a269f009
commit
9997a6b0b1
14 changed files with 163 additions and 72 deletions
|
|
@ -1,19 +1,15 @@
|
|||
use static_files::resource_dir;
|
||||
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use pagetop::util::bundle_resources;
|
||||
use pagetop_mdbook::util::except_mdbook_common_resources;
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
build_resource_dir("./static/doc/en", "guides_en")?;
|
||||
build_resource_dir("./static/doc/es", "guias_es")
|
||||
}
|
||||
|
||||
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.with_generated_fn(name);
|
||||
resource.build()
|
||||
bundle_resources(
|
||||
"./static/doc/en",
|
||||
"guides_en",
|
||||
Some(except_mdbook_common_resources),
|
||||
)?;
|
||||
bundle_resources(
|
||||
"./static/doc/es",
|
||||
"guias_es",
|
||||
Some(except_mdbook_common_resources),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue