update + htmx

This commit is contained in:
JMARyA 2024-12-22 18:37:45 +01:00
parent 40d69b61e1
commit 291949b8c6
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
8 changed files with 277 additions and 10 deletions

19
build.rs Normal file
View file

@ -0,0 +1,19 @@
use std::fs;
use std::path::Path;
fn main() {
let url = "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js";
let dest_path = Path::new("src/htmx.min.js");
println!("Downloading htmx.min.js from {}", url);
let response = reqwest::blocking::get(url)
.expect("Failed to send HTTP request")
.error_for_status()
.expect("Received error response from server");
let content = response.bytes().expect("Failed to read response body");
fs::write(&dest_path, &content).expect("Failed to write htmx.min.js to destination");
println!("cargo:rerun-if-changed=build.rs");
}