♻️ [bootstrap] Reubica archivos estáticos

This commit is contained in:
Manuel Cillero 2024-12-29 09:20:40 +01:00
parent 7d1b365b1c
commit 0a6d343db8
106 changed files with 30 additions and 31 deletions

View file

@ -4,10 +4,10 @@ use std::env;
use std::path::Path; use std::path::Path;
fn main() -> std::io::Result<()> { fn main() -> std::io::Result<()> {
StaticFilesBundle::from_scss("./static/bs-5.3.3/scss/bootstrap.scss", "bootstrap.min.css") StaticFilesBundle::from_scss("./static/scss/bootstrap.scss", "bootstrap.min.css")
.with_name("bootsier_bs") .with_name("bootsier_bs")
.build()?; .build()?;
StaticFilesBundle::from_dir("./static/bs-5.3.3/js", Some(bootstrap_js_files)) StaticFilesBundle::from_dir("./static/js", Some(bootstrap_js_files))
.with_name("bootsier_js") .with_name("bootsier_js")
.build() .build()
} }

View file

@ -37,7 +37,6 @@ impl PackageTrait for Bootsier {
} }
impl ThemeTrait for Bootsier { impl ThemeTrait for Bootsier {
/*
#[rustfmt::skip] #[rustfmt::skip]
fn regions(&self) -> Vec<(&'static str, L10n)> { fn regions(&self) -> Vec<(&'static str, L10n)> {
vec![ vec![
@ -46,13 +45,28 @@ impl ThemeTrait for Bootsier {
("nav_main", L10n::t("nav_main", &LOCALES_BOOTSIER)), ("nav_main", L10n::t("nav_main", &LOCALES_BOOTSIER)),
("nav_additional", L10n::t("nav_additional", &LOCALES_BOOTSIER)), ("nav_additional", L10n::t("nav_additional", &LOCALES_BOOTSIER)),
("breadcrumb", L10n::t("breadcrumb", &LOCALES_BOOTSIER)), ("breadcrumb", L10n::t("breadcrumb", &LOCALES_BOOTSIER)),
("content", L10n::t("breadcrumb", &LOCALES_BOOTSIER)), ("content", L10n::t("content", &LOCALES_BOOTSIER)),
("sidebar_first", L10n::t("sidebar_first", &LOCALES_BOOTSIER)), ("sidebar_first", L10n::t("sidebar_first", &LOCALES_BOOTSIER)),
("sidebar_second", L10n::t("sidebar_second", &LOCALES_BOOTSIER)), ("sidebar_second", L10n::t("sidebar_second", &LOCALES_BOOTSIER)),
("footer", L10n::t("footer", &LOCALES_BOOTSIER)), ("footer", L10n::t("footer", &LOCALES_BOOTSIER)),
] ]
} }
fn after_render_page_body(&self, page: &mut Page) {
page.alter_assets(AssetsOp::AddStyleSheet(
StyleSheet::from("/bootsier/bs/bootstrap.min.css")
.with_version(BOOTSTRAP_VERSION)
.with_weight(-99),
))
.alter_assets(AssetsOp::AddJavaScript(
JavaScript::defer("/bootsier/js/bootstrap.min.js")
.with_version(BOOTSTRAP_VERSION)
.with_weight(-99),
));
}
/*
fn prepare_body(&self, page: &mut Page) -> PrepareMarkup { fn prepare_body(&self, page: &mut Page) -> PrepareMarkup {
let skip_to_id = page.body_skip_to().get().unwrap_or("content".to_owned()); let skip_to_id = page.body_skip_to().get().unwrap_or("content".to_owned());
@ -83,21 +97,6 @@ impl ThemeTrait for Bootsier {
}) })
} }
*/ */
fn after_render_page_body(&self, page: &mut Page) {
page.alter_assets(AssetsOp::AddStyleSheet(
StyleSheet::from("/bootsier/bs/bootstrap.min.css")
.with_version(BOOTSTRAP_VERSION)
.with_weight(-99),
))
.alter_assets(AssetsOp::AddJavaScript(
JavaScript::defer("/bootsier/js/bootstrap.min.js")
.with_version(BOOTSTRAP_VERSION)
.with_weight(-99),
));
// .alter_assets(AssetsOp::AddStyleSheet(
// StyleSheet::from("/bootsier/css/styles.css").with_version("0.0.1"),
// ));
}
/* /*
} }

Some files were not shown because too many files have changed in this diff Show more