feat: version number display

This commit is contained in:
Zynh Ludwig 2025-01-14 00:09:43 -08:00
parent 7891157c53
commit e7b28b3214
6 changed files with 11 additions and 3 deletions

2
Cargo.lock generated
View file

@ -1335,7 +1335,7 @@ dependencies = [
[[package]] [[package]]
name = "nyazoom" name = "nyazoom"
version = "0.2.3" version = "0.2.4"
dependencies = [ dependencies = [
"async-bincode", "async-bincode",
"async-trait", "async-trait",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "nyazoom" name = "nyazoom"
version = "0.2.3" version = "0.2.4"
edition = "2021" edition = "2021"
authors = ["Zynh Ludwig <Zynh0722@gmail.com>"] authors = ["Zynh Ludwig <Zynh0722@gmail.com>"]
readme = "README.md" readme = "README.md"

6
dist/css/main.css vendored
View file

@ -25,7 +25,6 @@ body {
justify-content: center; justify-content: center;
} }
.cat-img { .cat-img {
width: 250px; width: 250px;
height: 250px; height: 250px;
@ -44,6 +43,11 @@ body {
text-align: center; text-align: center;
} }
#version {
align-self: end;
padding-right: 0.25em;
}
[type="file"] { [type="file"] {
border: 0; border: 0;
clip: rect(0, 0, 0, 0); clip: rect(0, 0, 0, 0);

View file

@ -10,6 +10,7 @@ pub use views::*;
use std::{path::PathBuf, sync::LazyLock}; use std::{path::PathBuf, sync::LazyLock};
pub static CARGO_VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION"));
pub static CACHE_DIR: LazyLock<PathBuf> = LazyLock::new(|| { pub static CACHE_DIR: LazyLock<PathBuf> = LazyLock::new(|| {
std::env::var("CACHE_DIR") std::env::var("CACHE_DIR")
.ok() .ok()

View file

@ -2,6 +2,8 @@ use rinja_axum::Template;
use crate::db::CacheRecord; use crate::db::CacheRecord;
use crate::CARGO_VERSION;
#[derive(Template)] #[derive(Template)]
#[template(path = "welcome.html")] #[template(path = "welcome.html")]
pub struct WelcomeTemplate { pub struct WelcomeTemplate {

View file

@ -18,5 +18,6 @@
<body> <body>
<h1>NyaZoom<sup>2</sup></h1> <h1>NyaZoom<sup>2</sup></h1>
{% block content %}{% endblock %} {% block content %}{% endblock %}
<footer id="version">{{ CARGO_VERSION }}</footer>
</body> </body>
</html> </html>