Adding some routing.

Moving more of the Blog pieces into the Blog library.
This commit is contained in:
2025-09-08 10:01:02 -04:00
parent 72e35cb6dc
commit 9db5a5ea3d
8 changed files with 126 additions and 26 deletions

View File

@ -3,6 +3,7 @@ use dioxus::prelude::*;
use tavern::{Adventurer, Legend, Lore, Tale};
use crate::page::Page;
use crate::server::*;
@ -83,7 +84,6 @@ pub fn TagList(children: Element) -> Element
}
/*
#[component]
pub fn BlogAuthor() -> Element
{
@ -133,8 +133,17 @@ pub fn BlogItem(title: String, slug: String, author: String,
#[component]
pub fn BlogList(children: Element) -> Element
pub fn BlogList(tags: Vec<String>, children: Element) -> Element
{
let summaries = use_server_future(move ||
{
let categories = tags.clone();
async move
{
get_blog_list(categories).await
}
})?;
rsx!
{
document::Link { rel: "stylesheet", href: LIST_CSS }
@ -145,16 +154,24 @@ pub fn BlogList(children: Element) -> Element
ul
{
class: "blog_list",
{children}
}
}
}
}
#[component]
pub fn BlogNav() -> Element
{
let tags = use_server_future(move ||
{
async move
{
get_tags().await
}
})?;
rsx!
{
document::Link { rel: "stylesheet", href: NAV_CSS }
@ -172,44 +189,28 @@ pub fn BlogNav() -> Element
li
{
class: "tag_item",
a { href: "/blog.html", "LeetCode" }
a { href: "/blog/LeetCode", "LeetCode" }
}
li
{
class: "tag_item",
a { href: "/blog.html", "Embedded" }
a { href: "/blog/Embedded", "Embedded" }
}
li
{
class: "tag_item",
a { href: "/blog.html", "Simulation" }
a { href: "/blog/Simulation", "Simulation" }
}
li
{
class: "tag_item",
a { href: "/blog.html", "Web" }
a { href: "/blog/Web", "Web" }
}
}
}
SocialButtonList
{
SocialButton
{
link: String::from("https://www.linkedin.com/company/cybermages-llc"),
company: Company::LinkedIn,
size: Size::Small
}
SocialButton
{
link: String::from("https://bsky.app/profile/cybermages.tech"),
company: Company::Bluesky,
size: Size::Small
}
}
}
}
}
*/
#[component]