diff --git a/bard/Cargo.toml b/bard/Cargo.toml index cb26933..29fe457 100644 --- a/bard/Cargo.toml +++ b/bard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bard" -version = "0.0.5" +version = "0.0.6" 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 267e7b2..e1570e6 100644 --- a/bard/src/components.rs +++ b/bard/src/components.rs @@ -283,9 +283,13 @@ pub fn PostHeader(title: String, author: String, tags: Vec) -> Element pub fn BlogPost(slug: String, children: Element) -> Element { // 1. Fetch the blog post using the slug. - let Ok(post) = use_server_future(move || get_blog_post(slug.clone())) else + let post = match use_server_future(move || get_blog_post(slug.clone())) { - return rsx! { p { "Failed to load post." } } + Ok(post) => { post } + Err(e) => + { + return rsx! { p { "Failed to load post." } p { "{e}" } } + } }; // Then build the component.