use actix_web::{web, HttpResponse, Responder}; use cached::proc_macro::once; use ramhorns::Content; use crate::{config::Config, template::Infos}; pub async fn page(config: web::Data) -> impl Responder { HttpResponse::NotFound().body(get_page(config.get_ref().clone())) } #[derive(Content)] struct Error404Template {} #[once(time = 60)] pub fn get_page(config: Config) -> String { config .tmpl .render("404.html", Error404Template {}, Infos::default()) }