all repos — breadsite @ 6d9728c367a862e7304292e322f68bfd35bb029f

Unnamed repository; edit this file 'description' to name the repository.

htmx mayhaps?
confusedbread confuseddbread@gmail.com
Mon, 30 Jun 2025 14:20:50 +0200
commit

6d9728c367a862e7304292e322f68bfd35bb029f

parent

28d25801570abc207e310b18e710fa24610cc2aa

1 files changed, 9 insertions(+), 3 deletions(-)

jump to
M src/main.rssrc/main.rs

@@ -1,8 +1,7 @@

-use actix_web::{get, web, App, HttpServer, Result as AwResult}; +use actix_web::{get, App, HttpServer, Result as AwResult}; use actix_files::Files; use maud::{DOCTYPE, html, Markup}; use std::io; -use chrono::Local; #[derive(Clone)] struct NavElement {

@@ -69,6 +68,13 @@ h1 { "Hiiii" }

} } +fn htmx_test() -> Markup { + html! { + script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js" {} + button hx-get="/click" hx-swap="outerHTML" { "Click Me" } + } +} + fn layout(page_title: &str, current: &str,site: Markup) -> Markup { html! { (head(page_title))

@@ -97,7 +103,7 @@

#[get("/3")] async fn breadsite_3() -> AwResult<Markup> { Ok(html! { - (layout(":333", "/3", breadsite())) + (layout(":333", "/3", htmx_test())) }) }