File tree Expand file tree Collapse file tree 4 files changed +2
-46
lines changed Expand file tree Collapse file tree 4 files changed +2
-46
lines changed Original file line number Diff line number Diff line change 1
- use pgml_components:: { component, Component } ;
1
+ use pgml_components:: component;
2
2
use sailfish:: TemplateOnce ;
3
3
4
4
#[ derive( TemplateOnce , Default , Clone ) ]
@@ -10,7 +10,6 @@ pub struct Head {
10
10
pub preloads : Vec < String > ,
11
11
pub context : Option < String > ,
12
12
pub canonical : Option < String > ,
13
- pub additional_components : Vec < Component > ,
14
13
}
15
14
16
15
impl Head {
@@ -59,25 +58,6 @@ impl Head {
59
58
self . context = context. to_owned ( ) ;
60
59
self
61
60
}
62
-
63
- /// Add a component to `<head>`.
64
- ///
65
- /// This can be anything, e.g. a `<script>` tag or a `<meta>` or just some HTML or text.
66
- ///
67
- /// # Example
68
- ///
69
- /// ```
70
- /// use pgml_components::Component;
71
- /// use pgml_components::layouts::Head;
72
- ///
73
- /// let head = Head::new()
74
- /// .add_component(Component::from("<script>console.log('hello');</script>"));
75
- /// ```
76
- ///
77
- pub fn add_component ( mut self , component : Component ) -> Self {
78
- self . additional_components . push ( component) ;
79
- self
80
- }
81
61
}
82
62
83
63
component ! ( Head ) ;
Original file line number Diff line number Diff line change 97
97
} ;
98
98
</ script >
99
99
< % } %>
100
-
101
- < % for component in additional_components { %>
102
- < %+ component %>
103
- < % } %>
104
100
</ head>
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::components::notifications::marketing::AlertBanner;
3
3
use crate :: guards:: Cluster ;
4
4
use crate :: models:: User ;
5
5
use crate :: Notification ;
6
- use pgml_components:: { component, Component } ;
6
+ use pgml_components:: component;
7
7
use sailfish:: TemplateOnce ;
8
8
use std:: fmt;
9
9
@@ -72,15 +72,6 @@ impl Base {
72
72
rsp
73
73
}
74
74
75
- /// Add a component to the `<head>`.
76
- ///
77
- /// See [`Head::add_component`](crate::components::layouts::Head::add_component) for more information.
78
- ///
79
- pub fn add_head_component ( mut self , component : Component ) -> Self {
80
- self . head = self . head . add_component ( component) ;
81
- self
82
- }
83
-
84
75
pub fn footer ( mut self , footer : String ) -> Self {
85
76
self . footer = Some ( footer) ;
86
77
self
Original file line number Diff line number Diff line change @@ -163,17 +163,6 @@ impl<'a> WebAppBase<'a> {
163
163
self
164
164
}
165
165
166
- /// Add a component to head (`<head>`).
167
- ///
168
- /// # Arguments
169
- ///
170
- /// * `component` - The component to add to the head.
171
- ///
172
- pub fn add_head_component ( & mut self , component : Component ) -> & mut Self {
173
- self . head = self . head . clone ( ) . add_component ( component) ;
174
- self
175
- }
176
-
177
166
pub fn render < T > ( & mut self , template : T ) -> String
178
167
where
179
168
T : sailfish:: TemplateOnce ,
You can’t perform that action at this time.
0 commit comments