diff --git a/Cargo.lock b/Cargo.lock index 60fc19f..cb2eae8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,8 +450,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-link", ] @@ -655,6 +657,7 @@ name = "cot-site" version = "0.1.0" dependencies = [ "askama", + "chrono", "cot", "cot-site-common", "cot-site-macros", diff --git a/Cargo.toml b/Cargo.toml index 83c8d80..fec96c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ resolver = "2" [workspace.dependencies] askama = "0.15" +chrono = "0.4" comrak = "0.50" cot = { version = "0.5", default-features = false } cot-site-common = { path = "cot-site-common" } @@ -33,6 +34,7 @@ nightly = ["cot-site-macros/nightly"] [dependencies] askama.workspace = true +chrono.workspace = true cot = { workspace = true, features = ["live-reload"] } cot-site-common.workspace = true cot-site-macros.workspace = true diff --git a/LICENSE-MIT b/LICENSE-MIT index 16d868a..efa0246 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024-2025 Mateusz Maćkowski and Cot contributors +Copyright (c) 2024-2026 Mateusz Maćkowski and Cot contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/main.rs b/src/main.rs index 899be3d..5ff7b24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ mod guides; +mod template_util; use std::time::Duration; diff --git a/src/template_util.rs b/src/template_util.rs new file mode 100644 index 0000000..92176c3 --- /dev/null +++ b/src/template_util.rs @@ -0,0 +1,5 @@ +use chrono::Datelike; + +pub(crate) fn current_year() -> i32 { + chrono::Utc::now().year() +} diff --git a/templates/_base.html b/templates/_base.html index 7bbd6a1..cf245e6 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -112,7 +112,7 @@
Cot
-

© 2024-2025 Cot contributors

+

© 2024-{{ template_util::current_year() }} Cot contributors