pub mod slug; use topcoat::{ Result, context::Cx, router::{href, page}, view::{View, component, view}, }; use crate::{app::Title, content::projects::Project}; pub fn detail_url(cx: &Cx, project: Project) -> String { href!(slug::detail, slug: project.slug()).resolve(cx) } #[component] pub async fn project_row(cx: &Cx, project: Project) -> Result { Ok(view! { (project.slug()) (project.name()) " · " (project.summary()) }) } #[page(with(Title(|_| "Projects · tahinli".to_owned())))] pub async fn index(cx: &Cx) -> Result { Ok(view! {

"Projects"

for project in Project::ALL { project_row(project: project) } }) }