ruskit/app/controllers/
pages.rs1use askama::Template;
2use askama_axum::Response;
3use crate::framework::views::{Metadata, TemplateExt, HasMetadata};
4use axum::response::Html;
5
6
7#[derive(Template, Default)]
9#[template(path = "about.html")]
10pub struct AboutTemplate {
11 pub first_name: String,
12 pub last_name: String,
13}
14
15#[derive(Template)]
17#[template(path = "landing.html")]
18pub struct LandingTemplate;
19
20
21pub async fn about() -> Response {
23 let mut about_template = AboutTemplate::with_metadata(
24 Metadata::new("About Us")
25 .with_description("Learn more about our team")
26 .with_og_title("About Us")
27 .with_og_description("Meet John Doe, a key member of our team")
28 );
29
30 about_template.first_name = "John".to_string();
31 about_template.last_name = "Doe".to_string();
32
33 about_template.into_response()
34}
35
36pub async fn landing() -> Html<String> {
38 let template = LandingTemplate;
39 Html(template.render().unwrap())
40}