Añade soporte nativo a Bootstrap con un nuevo tema

This commit is contained in:
Manuel Cillero 2022-02-21 00:28:22 +01:00
parent d38df3a5b6
commit 7f8b94eafe
37 changed files with 652 additions and 6 deletions

View file

@ -0,0 +1,28 @@
use crate::prelude::*;
include!(concat!(env!("OUT_DIR"), "/aliner.rs"));
pub struct AlinerTheme;
impl Theme for AlinerTheme {
fn name(&self) -> &str {
"Aliner"
}
fn configure_theme(&self, cfg: &mut server::web::ServiceConfig) {
cfg.service(actix_web_static_files::ResourceFiles::new(
"/aliner",
generate()
));
}
fn before_render_page(&self, page: &mut Page) {
page.assets()
.add_stylesheet(
StyleSheet::source(
"/aliner/css/styles.css"
)
.with_weight(-99)
);
}
}