add manifest

This commit is contained in:
JMARyA 2023-09-18 19:31:44 +02:00
parent abceac2073
commit 069595aec0
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 29 additions and 18 deletions

View file

@ -14,11 +14,18 @@ async fn main() -> std::io::Result<()> {
let conf = config::Config::new();
web_base::bootstrap::cache_bootstrap().await;
let manifest = web_base::Manifest::new(&conf.name().unwrap())
.set_short_name(&conf.name().unwrap())
.set_start_url("/")
.set_background_color(&conf.bg_color().unwrap())
.add_icon("/assets/me", "2000x1949", "image/avif");
web_base::map!(
web_base::Site::new()
.enable_bootstrap(true)
.enable_scaling(true)
.enable_favicon("/assets/me".to_string()),
.enable_favicon("/assets/me".to_string())
.add_manifest(manifest),
|x: App<_>| {
x.app_data(web::Data::new(conf.clone()))
.service(pages::index::index)

View file

@ -35,5 +35,9 @@ pub(crate) async fn build_site(
};
};
web_base::func::build_site_from_body(&web_base::Site::from_request(&r), title, &body.into_string())
web_base::func::build_site_from_body(
&web_base::Site::from_request(&r),
title,
&body.into_string(),
)
}