Askama + htmx for frontend

Server-side rendering with htmx and Tailwind CSS for the styling
This commit is contained in:
Alphonse Paix
2025-09-16 01:47:18 +02:00
parent 7c8ac0361e
commit 8a977df948
9 changed files with 402 additions and 36 deletions

View File

@@ -1,5 +1,11 @@
use axum::response::{Html, IntoResponse};
use askama::Template;
use axum::response::Html;
pub async fn home() -> impl IntoResponse {
Html(include_str!("home/home.html"))
#[derive(Template)]
#[template(path = "../templates/home.html")]
struct HomeTemplate;
pub async fn home() -> Html<String> {
let template = HomeTemplate;
Html(template.render().unwrap())
}