🚚 [pagetop] Recupera "favicon.ico" predeterminado
This commit is contained in:
parent
2c4a09417e
commit
fc579fc29d
3 changed files with 18 additions and 2 deletions
3
pagetop/build.rs
Normal file
3
pagetop/build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() -> std::io::Result<()> {
|
||||
pagetop_build::bundle_resources("./static/theme", "theme", None)
|
||||
}
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
use crate::core::module::{ModuleTrait, ThemeStaticRef, ThemeTrait};
|
||||
use crate::pub_handle;
|
||||
use crate::html::Favicon;
|
||||
use crate::response::page::Page;
|
||||
use crate::server;
|
||||
use crate::util::Handle;
|
||||
use crate::{pub_handle, serve_static_files};
|
||||
|
||||
pub_handle!(THEME_BASIC);
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/theme.rs"));
|
||||
|
||||
pub struct Basic;
|
||||
|
||||
impl ModuleTrait for Basic {
|
||||
|
|
@ -14,6 +19,14 @@ impl ModuleTrait for Basic {
|
|||
fn theme(&self) -> Option<ThemeStaticRef> {
|
||||
Some(&Basic)
|
||||
}
|
||||
|
||||
fn configure_service(&self, cfg: &mut server::web::ServiceConfig) {
|
||||
serve_static_files!(cfg, "/theme", bundle_theme);
|
||||
}
|
||||
}
|
||||
|
||||
impl ThemeTrait for Basic {}
|
||||
impl ThemeTrait for Basic {
|
||||
fn before_render_page(&self, page: &mut Page) {
|
||||
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
pagetop/static/theme/favicon.ico
Normal file
BIN
pagetop/static/theme/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Loading…
Add table
Add a link
Reference in a new issue