diff options
Diffstat (limited to 'server/src/routes/ui/layout.rs')
-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" } " " |