From e7b28b32145f3db34669f392c919eda875ee68bb Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Tue, 14 Jan 2025 00:09:43 -0800 Subject: [PATCH] feat: version number display --- Cargo.lock | 2 +- Cargo.toml | 2 +- dist/css/main.css | 6 +++++- src/lib.rs | 1 + src/views/templates.rs | 2 ++ templates/base.html | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0cd4461..3af0482 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "nyazoom" -version = "0.2.3" +version = "0.2.4" dependencies = [ "async-bincode", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 4e53958..2b9fc1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nyazoom" -version = "0.2.3" +version = "0.2.4" edition = "2021" authors = ["Zynh Ludwig "] readme = "README.md" diff --git a/dist/css/main.css b/dist/css/main.css index b370086..60c1988 100644 --- a/dist/css/main.css +++ b/dist/css/main.css @@ -25,7 +25,6 @@ body { justify-content: center; } - .cat-img { width: 250px; height: 250px; @@ -44,6 +43,11 @@ body { text-align: center; } +#version { + align-self: end; + padding-right: 0.25em; +} + [type="file"] { border: 0; clip: rect(0, 0, 0, 0); diff --git a/src/lib.rs b/src/lib.rs index b30c09b..b9af0bb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,6 +10,7 @@ pub use views::*; use std::{path::PathBuf, sync::LazyLock}; +pub static CARGO_VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION")); pub static CACHE_DIR: LazyLock = LazyLock::new(|| { std::env::var("CACHE_DIR") .ok() diff --git a/src/views/templates.rs b/src/views/templates.rs index d55e5ad..dc37646 100644 --- a/src/views/templates.rs +++ b/src/views/templates.rs @@ -2,6 +2,8 @@ use rinja_axum::Template; use crate::db::CacheRecord; +use crate::CARGO_VERSION; + #[derive(Template)] #[template(path = "welcome.html")] pub struct WelcomeTemplate { diff --git a/templates/base.html b/templates/base.html index fc6692e..7568362 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,5 +18,6 @@

NyaZoom2

{% block content %}{% endblock %} +