Adding some routing.
Moving more of the Blog pieces into the Blog library.
This commit is contained in:
@ -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]
|
||||
|
||||
Reference in New Issue
Block a user