add manifest
This commit is contained in:
parent
abceac2073
commit
069595aec0
3 changed files with 29 additions and 18 deletions
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue