diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-20 15:43:57 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-20 15:43:57 +0100 |
commit | 42f7a95ce67506344b694535ff193745452c6e29 (patch) | |
tree | 1ad84cd1c86b76b4efd7fecb26debe3da44f99a4 /server/src/routes/ui | |
parent | 9499c195230a7d5adaebd46892b373c86c5248c2 (diff) | |
download | jellything-42f7a95ce67506344b694535ff193745452c6e29.tar jellything-42f7a95ce67506344b694535ff193745452c6e29.tar.bz2 jellything-42f7a95ce67506344b694535ff193745452c6e29.tar.zst |
custom logo support
Diffstat (limited to 'server/src/routes/ui')
-rw-r--r-- | server/src/routes/ui/layout.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/routes/ui/layout.rs b/server/src/routes/ui/layout.rs index d4d443c..faf5527 100644 --- a/server/src/routes/ui/layout.rs +++ b/server/src/routes/ui/layout.rs @@ -25,7 +25,9 @@ use rocket::{ response::{self, Responder}, Request, Response, }; -use std::io::Cursor; +use std::{io::Cursor, sync::LazyLock}; + +static LOGO_ENABLED: LazyLock<bool> = LazyLock::new(|| CONF.asset_path.join("logo.svg").exists()); markup::define! { Layout<'a, Main: Render>(title: String, main: Main, class: &'a str, session: Option<Session>) { @@ -39,7 +41,7 @@ markup::define! { } body[class=class] { nav { - h1 { a[href="/"] { @CONF.brand } } " " + h1 { a[href="/"] { @if *LOGO_ENABLED { img.logo[src="/assets/logo.svg"]; } else { @CONF.brand } } } " " @if let Some(_) = session { a.library[href=uri!(r_library_node("library"))] { "My Library" } " " a.library[href=uri!(r_all_items())] { "All Items" } " " |