♻️ Add Favicon in assets and let context manage it
This commit is contained in:
parent
5fb0a1332e
commit
ce28bf3e2f
9 changed files with 82 additions and 69 deletions
|
|
@ -14,17 +14,19 @@ impl PackageTrait for Basic {
|
|||
|
||||
impl ThemeTrait for Basic {
|
||||
fn after_prepare_body(&self, page: &mut Page) {
|
||||
page.set_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/basic.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
page.set_assets(AssetsOp::SetFavicon(
|
||||
Some(Favicon::new().with_icon("/base/favicon.ico")),
|
||||
))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/basic.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,17 +14,19 @@ impl PackageTrait for Chassis {
|
|||
|
||||
impl ThemeTrait for Chassis {
|
||||
fn after_prepare_body(&self, page: &mut Page) {
|
||||
page.set_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/chassis.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
page.set_assets(AssetsOp::SetFavicon(
|
||||
Some(Favicon::new().with_icon("/base/favicon.ico")),
|
||||
))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/chassis.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,17 +14,19 @@ impl PackageTrait for Inception {
|
|||
|
||||
impl ThemeTrait for Inception {
|
||||
fn after_prepare_body(&self, page: &mut Page) {
|
||||
page.set_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/inception.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
page.set_assets(AssetsOp::SetFavicon(
|
||||
Some(Favicon::new().with_icon("/base/favicon.ico")),
|
||||
))
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/normalize.min.css")
|
||||
.with_version("8.0.1")
|
||||
.with_weight(-90),
|
||||
))
|
||||
.set_assets(AssetsOp::AddBaseAssets)
|
||||
.set_assets(AssetsOp::AddStyleSheet(
|
||||
StyleSheet::from("/base/css/inception.css")
|
||||
.with_version("0.0.1")
|
||||
.with_weight(-90),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue