mod assets; mod blocks; mod posts; mod projects; use topcoat::{ Result, context::{Cx, context}, router::{Router, RouterBuilderDiscoverExt, Slot, href, layout, module_router, page}, view::{View, component, view}, }; use crate::content::{posts::Post, projects::Project}; pub struct Title(pub fn(&Cx) -> String); pub fn router() -> Router { module_router!().discover().build() } #[component] async fn site_header(cx: &Cx) -> Result { let posts = href!(posts::index); let projects = href!(projects::index); let posts_current = posts.is_current(cx); let projects_current = projects.is_current(cx); Ok(view! { }) } #[component] async fn site_footer(cx: &Cx) -> Result { Ok(view! { }) } #[layout(with(Title(|_| "Ahmet Kaan Gümüş".to_owned())))] async fn root_layout(cx: &Cx, slot: Slot<'_>) -> Result { let Title(render) = context::(cx); let title = render(cx); Ok(view! { <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>(title)
site_header()
(slot)
site_footer()
}) } #[page] async fn home(cx: &Cx) -> Result { Ok(view! {

"Ahmet Kaan Gümüş"

"Computer Scientist."

"I’m Ahmet Kaan. I’m Turkish and was born in 2001. I graduated with a degree in Computer Engineering from Erciyes University. I’m keen on understanding computers as deeply as possible and I love the open‑source philosophy and the KISS principle."

"My passion is to create software that can stand the test of time. Developers should write versatile, bug‑free programs. It’s impossible to ignore the impact of software. Today’s world is led by it and will continue to be. As developers, we must consider as many possibilities as we can in order to build robust and secure applications."

"I hope to create free and open‑source software that is widely used, allowing people to benefit from it without having to worry about privacy or the reliability of the program."

"Writing"

for post in Post::ALL { posts::post_row(post: post) }

"Projects"

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