use topcoat::{ Result, context::Cx, router::{error::RouterErrorExt, href, module_param, page}, view::{View, view}, }; use crate::{ app::{Title, blocks::blocks}, content::projects::Project, }; module_param!(pub slug); fn title(cx: &Cx) -> String { match Project::from_slug(slug(cx)) { Some(project) => format!("{} · tahinli", project.name()), None => String::from("tahinli"), } } #[page(with(Title(title)))] pub async fn detail(cx: &Cx) -> Result { let project = Project::from_slug(slug(cx)).ok_or_not_found()?; Ok(view! {
"← projects"

(project.name())

(project.summary())

"source ↗" blocks(items: project.body())
}) }