Add build date to logs

ssg-yew-search
Blake Rain 2023-09-03 12:21:33 +01:00
parent 58cfb4e9d9
commit 2f69f1d3ab
3 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,9 @@ required-features = [
[[bin]]
name = "site"
[build-dependencies]
time = { version = "0.3", features = ["formatting"] }
[dependencies]
async-trait = { version = "0.1" }
enum-iterator = { version = "1.4" }

View File

@ -1,3 +1,12 @@
use time::{format_description::well_known::Rfc2822, OffsetDateTime};
fn main() {
println!("cargo:rerun-if-changed=content");
println!(
"cargo:rustc-env=BUILD_TIME={}",
OffsetDateTime::now_utc()
.format(&Rfc2822)
.expect("time format")
);
}

View File

@ -19,6 +19,8 @@ fn main() {
}
);
log::info!("Compiled {}", env!("BUILD_TIME"));
let app = yew::Renderer::<App>::new();
#[cfg(feature = "hydration")]