diff options
| author | Fuwn <[email protected]> | 2026-01-14 02:54:51 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-14 02:54:51 -0800 |
| commit | 9565088365b6094c235e3f7862add1d3da84fd1a (patch) | |
| tree | 3c607be598f28ec9317992f8a20c7c943960c100 /src/response.rs | |
| parent | fix: Various optimisations (diff) | |
| download | locus-9565088365b6094c235e3f7862add1d3da84fd1a.tar.xz locus-9565088365b6094c235e3f7862add1d3da84fd1a.zip | |
feat: Template footer year
Diffstat (limited to 'src/response.rs')
| -rw-r--r-- | src/response.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/response.rs b/src/response.rs index 9c1cc69..8851b18 100644 --- a/src/response.rs +++ b/src/response.rs @@ -1,4 +1,4 @@ -use {std::sync::LazyLock, windmark::response::Response}; +use {chrono::Datelike, std::sync::LazyLock, windmark::response::Response}; static QUOTES: LazyLock<Vec<String>> = LazyLock::new(|| { serde_json::from_str(include_str!("../content/json/quotes.json")).unwrap() @@ -14,6 +14,7 @@ struct Main<'a> { pub commit: &'a str, pub mini_commit: &'a str, pub header_image: &'a str, + pub year: i32, } pub fn success( @@ -32,6 +33,7 @@ pub fn success( commit: &format!("/tree/{}", env!("VERGEN_GIT_SHA")), mini_commit: env!("VERGEN_GIT_SHA").get(0..5).unwrap_or("UNKNOWN"), header_image: &std::env::var("HEADER_IMAGE").unwrap_or_else(|_| "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/27/8b/e1/278be12a-185e-2b65-aa68-7e7e98b140f7/859754679778_cover.jpg/316x316bb.webp".to_string()), + year: chrono::Utc::now().year(), } .to_string(), ) |