caio.co/de/chuva

info: expose current head as version

Id
a42d4e64b15d4c77cae1394dd52c6e28e3818ee1
Author
Caio
Commit time
2025-12-03T09:16:35+01:00

Modified moros/README

@@ -8,6 +8,10

cargo run -- cli /path/to/dataset-dir <POSTCODE|OFFSET|<LATITUDE LONGITUDE>>

+DEPLOY
+
+ GIT_VERSION=$(git describe --always --dirty) cargo build --release
+
REGEN POSTCODE FST

# data at https://github.com/caio/netherlands-postcode-geojson

Modified moros/src/ui.rs

@@ -92,6 +92,8
}
}

+const VERSION: Option<&str> = option_env!("GIT_VERSION");
+
#[derive(Template)]
#[template(path = "info.html.jinja")]
pub struct Info<'a> {
@@ -99,6 +101,7
age: Minutes,
kind: ModelKind,
status: &'static str,
+ version: &'static str,
}

impl<'a> Info<'a> {
@@ -126,6 +129,7
dataset,
status,
kind: moros.kind(),
+ version: VERSION.unwrap_or("Unknown"),
}
}

Modified moros/templates/info.html.jinja

@@ -5,6 +5,7
<div class="center">{{ status }}</div>

<ul class="small">
+<li>Version: {{ version }}</li>
<li>File: {{ dataset }}</li>
<li>Kind: {{ kind }}</li>
<li>Age: {{ age }}</li>