diff --git a/pagetop/src/html/assets/javascript.rs b/pagetop/src/html/assets/javascript.rs index be7a42f2..848c81bc 100644 --- a/pagetop/src/html/assets/javascript.rs +++ b/pagetop/src/html/assets/javascript.rs @@ -13,8 +13,6 @@ pub enum ModeJS { #[derive(Default)] pub struct JavaScript { source : String, - prefix : &'static str, - version: &'static str, weight : isize, mode : ModeJS, } @@ -31,7 +29,7 @@ impl AssetsTrait for JavaScript { fn prepare(&self) -> Markup { html! { script type="text/javascript" - src=(crate::concat_string!(self.source, self.prefix, self.version)) + src=(self.source) async[self.mode == ModeJS::Async] defer[self.mode == ModeJS::Defer] {}; @@ -50,15 +48,6 @@ impl JavaScript { } } - pub fn with_version(mut self, version: &'static str) -> Self { - (self.prefix, self.version) = if version.is_empty() { - ("", "") - } else { - ("?ver=", version) - }; - self - } - pub fn with_weight(mut self, weight: isize) -> Self { self.weight = weight; self diff --git a/pagetop/src/html/assets/stylesheet.rs b/pagetop/src/html/assets/stylesheet.rs index 339f44f6..0afecfb7 100644 --- a/pagetop/src/html/assets/stylesheet.rs +++ b/pagetop/src/html/assets/stylesheet.rs @@ -12,8 +12,6 @@ pub enum TargetMedia { #[derive(Default)] pub struct StyleSheet { source : String, - prefix : &'static str, - version: &'static str, media : Option<&'static str>, weight : isize, } @@ -28,12 +26,7 @@ impl AssetsTrait for StyleSheet { } fn prepare(&self) -> Markup { - html! { - link - rel="stylesheet" - href=(crate::concat_string!(self.source, self.prefix, self.version)) - media=[self.media]; - } + html! { link rel="stylesheet" href=(self.source) media=[self.media]; } } } @@ -48,15 +41,6 @@ impl StyleSheet { } } - pub fn with_version(mut self, version: &'static str) -> Self { - (self.prefix, self.version) = if version.is_empty() { - ("", "") - } else { - ("?ver=", version) - }; - self - } - pub fn with_weight(mut self, weight: isize) -> Self { self.weight = weight; self