use actix_web::{get, web, HttpResponse, Responder}; use ramhorns::Content; use crate::{config::Config, template::Infos}; #[get("/")] pub async fn page(config: web::Data) -> impl Responder { HttpResponse::Ok().body(get_page(config.get_ref().clone())) } #[derive(Content)] struct IndexTemplate {} pub fn get_page(config: Config) -> std::string::String { config.tmpl.render( "index.html", IndexTemplate {}, Infos { page_title: Some("Mylloon".to_string()), page_desc: Some("Page principale".to_string()), }, ) }