diff --git a/src/endpoints/static_resources.rs b/src/endpoints/static_resources.rs index 9a5318e..728d617 100644 --- a/src/endpoints/static_resources.rs +++ b/src/endpoints/static_resources.rs @@ -8,6 +8,12 @@ struct WaterCSS<'a> { _marker: PhantomData<&'a ()>, } +#[derive(Template)] +#[template(path = "favicon.svg", escape = "none")] +struct Favicon<'a> { + _marker: PhantomData<&'a ()>, +} + #[get("/static/{resource}")] pub async fn static_resources(resource_id: web::Path) -> HttpResponse { match resource_id.into_inner().as_str() { @@ -18,6 +24,13 @@ pub async fn static_resources(resource_id: web::Path) -> HttpResponse { .render() .unwrap(), ), + "favicon.svg" => HttpResponse::Ok().content_type("image/svg+xml").body( + Favicon { + _marker: Default::default(), + } + .render() + .unwrap(), + ), _ => HttpResponse::NotFound().content_type("text/html").finish(), } } diff --git a/templates/header.html b/templates/header.html index 37d2de0..46bb7dc 100644 --- a/templates/header.html +++ b/templates/header.html @@ -9,6 +9,7 @@ + {% if !args.pure_html %} {%- endif %}