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,14 +1,13 @@
use pagetop::prelude::*;
use pagetop_mdbook::BookMapResources;
use pagetop_mdbook::MdBook;
pub_const_handler!(APP_PAGETOP_WEBSITE);
include!(concat!(env!("OUT_DIR"), "/guides_en.rs"));
static GUIDES_EN: LazyStatic<BookMapResources> = LazyStatic::new(guides_en);
static GUIDES_EN: LazyStatic<HashMapResources> = LazyStatic::new(bundle_guides_en);
include!(concat!(env!("OUT_DIR"), "/guias_es.rs"));
static GUIAS_ES: LazyStatic<BookMapResources> = LazyStatic::new(guias_es);
static GUIAS_ES: LazyStatic<HashMapResources> = LazyStatic::new(bundle_guias_es);
struct PageTopWebSite;
@ -22,9 +21,9 @@ impl ModuleTrait for PageTopWebSite {
}
fn configure_service(&self, cfg: &mut app::web::ServiceConfig) {
MdBook::configure_mdbook_common(cfg);
MdBook::configure_mdbook_service(cfg, "/doc/en", &GUIDES_EN);
MdBook::configure_mdbook_service(cfg, "/doc/es", &GUIAS_ES);
MdBook::configure_service_for_common_resources(cfg);
MdBook::configure_service_for_mdbook(cfg, "/doc/en", &GUIDES_EN);
MdBook::configure_service_for_mdbook(cfg, "/doc/es", &GUIAS_ES);
}
}