🎉 [aliner] Saca tema del código base de PageTop

This commit is contained in:
Manuel Cillero 2023-02-02 08:45:52 +01:00
parent e98141281a
commit fd54389cd5
5 changed files with 439 additions and 0 deletions

30
pagetop-aliner/src/lib.rs Normal file
View file

@ -0,0 +1,30 @@
use pagetop::prelude::*;
pub_handle!(THEME_ALINER);
include!(concat!(env!("OUT_DIR"), "/aliner.rs"));
pub struct Aliner;
impl ModuleTrait for Aliner {
fn handle(&self) -> Handle {
THEME_ALINER
}
fn theme(&self) -> Option<ThemeStaticRef> {
Some(&Aliner)
}
fn configure_service(&self, cfg: &mut server::web::ServiceConfig) {
serve_static_files!(cfg, "/aliner", bundle_aliner);
}
}
impl ThemeTrait for Aliner {
fn before_render_page(&self, page: &mut Page) {
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")))
.alter_context(ContextOp::AddStyleSheet(
StyleSheet::located("/aliner/css/styles.css").with_weight(-99),
));
}
}