fix: add timestamp to tailwind output only on debug

This commit is contained in:
Araozu 2024-10-26 23:13:37 -05:00
parent 289d5be4a3
commit 09cfec65ec

View File

@ -111,12 +111,18 @@ fn index() -> Markup {
} }
fn skeleton(children: Markup) -> Markup { fn skeleton(children: Markup) -> Markup {
// add a timestamp on debug builds
let tailwind_path = if cfg!(debug_assertions) {
let ms = SystemTime::now() let ms = SystemTime::now()
.duration_since(UNIX_EPOCH) .duration_since(UNIX_EPOCH)
.unwrap() .unwrap()
.as_millis(); .as_millis();
let tailwind_path = format!("/public/output.css?t={}", ms); format!("/public/output.css?t={}", ms)
} else {
String::from("/public/output.css")
};
html! { html! {
(DOCTYPE) (DOCTYPE)
html lang="es" { html lang="es" {