mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Move git version info gather in into a build script
This commit is contained in:
@@ -20,6 +20,8 @@ crate-type = [
|
||||
|
||||
|
||||
[dependencies]
|
||||
conduwuit-build-metadata.workspace = true
|
||||
|
||||
askama = "0.14.0"
|
||||
|
||||
axum.workspace = true
|
||||
|
||||
@@ -5,6 +5,7 @@ use axum::{
|
||||
response::{Html, IntoResponse, Response},
|
||||
routing::get,
|
||||
};
|
||||
use conduwuit_build_metadata::{GIT_REMOTE_COMMIT_URL, GIT_REMOTE_WEB_URL, VERSION_EXTRA};
|
||||
|
||||
pub fn build<S>() -> Router<()> { Router::new().route("/", get(index_handler)) }
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
{%~ block footer ~%}
|
||||
<footer>
|
||||
<p>Powered by <a href="https://continuwuity.org">Continuwuity</a>
|
||||
{%~ if let Some(version_info) = option_env!("CONDUWUIT_VERSION_EXTRA").or(option_env!("SHORT_COMMIT_SHA")) ~%}
|
||||
{%~ if let Some(url) = option_env!("REMOTE_COMMIT_URL").or(option_env!("REMOTE_URL")) ~%}
|
||||
{%~ if let Some(version_info) = VERSION_EXTRA ~%}
|
||||
{%~ if let Some(url) = GIT_REMOTE_COMMIT_URL.or(GIT_REMOTE_WEB_URL) ~%}
|
||||
(<a href="{{ url }}">{{ version_info }}</a>)
|
||||
{%~ else ~%}
|
||||
({{ version_info }})
|
||||
|
||||
Reference in New Issue
Block a user