From bf356774f887009afbf70401ed8f4eb0f401bd31 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Mon, 26 Jun 2023 22:28:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=EF=B8=8F=20Aplica=20cambio=20de=20?= =?UTF-8?q?uso=20de=20estilos=20y=20javascripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop-bootsier/src/lib.rs | 7 ++----- pagetop-bulmix/src/lib.rs | 4 +--- pagetop-megamenu/src/component.rs | 18 +++++++++--------- pagetop-minimal/src/component/icon.rs | 6 +++--- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pagetop-bootsier/src/lib.rs b/pagetop-bootsier/src/lib.rs index 976d37d1..caa103b4 100644 --- a/pagetop-bootsier/src/lib.rs +++ b/pagetop-bootsier/src/lib.rs @@ -45,13 +45,10 @@ impl ThemeTrait for Bootsier { fn before_prepare_page(&self, page: &mut Page) { page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( - StyleSheet::located("/bootsier/css/bootstrap.min.css") - .with_version("5.1.3") - .with_weight(-99), + StyleSheet::located("/bootsier/css/bootstrap.min.css?v=5.1.3").with_weight(-99), )) .alter_context(ContextOp::AddJavaScript( - JavaScript::located("/bootsier/js/bootstrap.bundle.min.js") - .with_version("5.1.3") + JavaScript::located("/bootsier/js/bootstrap.bundle.min.js?v=5.1.3") .with_weight(-99), )); pagetop_jquery::JQuery::add_jquery(page.context()); diff --git a/pagetop-bulmix/src/lib.rs b/pagetop-bulmix/src/lib.rs index 59fc8dee..6dc04a8a 100644 --- a/pagetop-bulmix/src/lib.rs +++ b/pagetop-bulmix/src/lib.rs @@ -33,9 +33,7 @@ impl ThemeTrait for Bulmix { fn before_prepare_page(&self, page: &mut Page) { page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( - StyleSheet::located("/bulmix/css/bulma.min.css") - .with_version("0.9.4") - .with_weight(-99), + StyleSheet::located("/bulmix/css/bulma.min.css?v=0.9.4").with_weight(-99), )); pagetop_jquery::JQuery::add_jquery(page.context()); } diff --git a/pagetop-megamenu/src/component.rs b/pagetop-megamenu/src/component.rs index 0ec50ec1..c6747943 100644 --- a/pagetop-megamenu/src/component.rs +++ b/pagetop-megamenu/src/component.rs @@ -192,15 +192,15 @@ impl ComponentTrait for MegaMenu { } fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup { - rcx.alter(ContextOp::AddStyleSheet( - StyleSheet::located("/megamenu/css/menu.css").with_version("1.1.1"), - )) - .alter(ContextOp::AddStyleSheet( - StyleSheet::located("/megamenu/css/menu-clean.css").with_version("1.1.1"), - )) - .alter(ContextOp::AddJavaScript( - JavaScript::located("/megamenu/js/menu.min.js").with_version("1.1.1"), - )); + rcx.alter(ContextOp::AddStyleSheet(StyleSheet::located( + "/megamenu/css/menu.css?v=1.1.1", + ))) + .alter(ContextOp::AddStyleSheet(StyleSheet::located( + "/megamenu/css/menu-clean.css?v=1.1.1", + ))) + .alter(ContextOp::AddJavaScript(JavaScript::located( + "/megamenu/js/menu.min.js?v=1.1.1", + ))); pagetop_jquery::JQuery::add_jquery(rcx); let id = rcx.required_id::(self.id()); diff --git a/pagetop-minimal/src/component/icon.rs b/pagetop-minimal/src/component/icon.rs index 7d5599f8..87cb564d 100644 --- a/pagetop-minimal/src/component/icon.rs +++ b/pagetop-minimal/src/component/icon.rs @@ -29,9 +29,9 @@ impl ComponentTrait for Icon { } fn before_prepare_component(&mut self, rcx: &mut RenderContext) { - rcx.alter(ContextOp::AddStyleSheet( - StyleSheet::located("/minimal/icons/bootstrap-icons.css").with_version("1.8.2"), - )); + rcx.alter(ContextOp::AddStyleSheet(StyleSheet::located( + "/minimal/icons/bootstrap-icons.css?v=1.8.2", + ))); } fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {