Askama + htmx for frontend
Server-side rendering with htmx and Tailwind CSS for the styling
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user