From 72e35cb6dc489c6d167715d929c7ebd6e8ca6a63 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Sun, 7 Sep 2025 19:27:26 -0400 Subject: [PATCH] Testing out the Author now. --- bard/Cargo.toml | 2 +- bard/src/components.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bard/Cargo.toml b/bard/Cargo.toml index 4e8d16e..bcae8cb 100644 --- a/bard/Cargo.toml +++ b/bard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bard" -version = "0.0.9" +version = "0.0.10" edition = "2024" description = "Dioxus components that will display a Tavern blogging system Blog." repository = "/CyberMages/tavern" diff --git a/bard/src/components.rs b/bard/src/components.rs index f5fcfae..db2027e 100644 --- a/bard/src/components.rs +++ b/bard/src/components.rs @@ -224,10 +224,15 @@ pub fn PostHeaderAuthor(name: String, handle: String, profile_link: String) -> E #[component] pub fn PostHeader(title: String, author: String, tags: Vec) -> Element { - let Ok(author) = use_server_future(move || get_author(author.clone())) else + let author = use_server_future(move || { - return rsx! { p { "Failed to load author." } } - }; + let target_author = author.clone(); + async move + { + get_author(target_author).await + } + })?; + rsx! { @@ -282,8 +287,6 @@ pub fn PostHeader(title: String, author: String, tags: Vec) -> Element #[component] pub fn BlogPost(slug: String, children: Element) -> Element { - let test_slug = slug.clone(); - // 1. Fetch the blog post using the slug. let post = use_server_future(move || { let url_slug = slug.clone(); @@ -293,7 +296,6 @@ pub fn BlogPost(slug: String, children: Element) -> Element } })?; - // Then build the component. rsx! { document::Link { rel: "stylesheet", href: POST_CSS } @@ -324,7 +326,6 @@ pub fn BlogPost(slug: String, children: Element) -> Element rsx! { p { "Unable to show desired post." } - p { "Trying to get: {test_slug}" } p { "{e}" } } }