aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/routes/ui/layout.rs6
-rw-r--r--web/style/navbar.css6
2 files changed, 9 insertions, 3 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" } " "
diff --git a/web/style/navbar.css b/web/style/navbar.css
index bec46cf..1cffb9e 100644
--- a/web/style/navbar.css
+++ b/web/style/navbar.css
@@ -19,6 +19,10 @@ nav {
align-items: center;
}
+nav a .logo {
+ height: 1.5em;
+}
+
nav a {
display: inline-block;
border: 0px solid transparent;
@@ -97,4 +101,4 @@ nav .back::before {
nav .library {
display: none;
}
-} \ No newline at end of file
+}