From 56a9c7bd401c02e7103d50738d83a34ca04b2428 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 26 Feb 2025 05:13:12 -0300 Subject: [PATCH 1/2] chore: fix restart when updating frontend files --- .justfile | 2 +- frontend/templates/index.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.justfile b/.justfile index a2937eb..93db81c 100644 --- a/.justfile +++ b/.justfile @@ -10,7 +10,7 @@ docker-compose +ARGS: start-dev-services: (docker-compose "up --remove-orphans") dev: - watchexec --restart --clear --watch src --watch dist cargo run + watchexec --no-vcs-ignore --clear --restart --watch=dist --watch=src cargo run migrate: (docker-compose "run dbmate migrate") diff --git a/frontend/templates/index.html b/frontend/templates/index.html index c7591f0..9137d3f 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -6,6 +6,7 @@ +

Axum example! 1

{% block htmx %} From 8e1e366964e23956ccdc2467da89d0bbf2c99765 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 26 Feb 2025 05:20:04 -0300 Subject: [PATCH 2/2] fix: embedded templates path on build --- build.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 99c7b3a..c37742a 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ fn main() { // only enable in production build #[cfg(not(debug_assertions))] - minijinja_embed::embed_templates!("templates"); + minijinja_embed::embed_templates!("dist"); } diff --git a/src/main.rs b/src/main.rs index 824067f..8d0c12a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ fn load_templates() -> Result> { // only enable in production build #[cfg(not(debug_assertions))] - minijinja_embed::load_templates!(&mut env); + minijinja_embed::load_templates!(&mut tmpl_env); let global_routes = vec![Link { path: "/about".to_owned(),