From f1c471839f2d0b7ba6ceda3d6e249fc006f0f75e Mon Sep 17 00:00:00 2001 From: i0uring Date: Thu, 21 Aug 2025 02:19:36 +0000 Subject: [PATCH] :sparkles: readd btns :bug: fixed some blog stuff --- .gitignore | 1 + Cargo.toml | 2 + src/main.rs | 244 ++++++++++++++++++----------------- src/pages/blog/author.rs | 61 ++------- src/pages/blog/authorcard.rs | 28 ++-- src/pages/blog/authors.rs | 10 +- src/pages/blog/content.rs | 138 +++++--------------- src/pages/blog/entries.rs | 84 +++--------- src/pages/blog/entry.rs | 132 ++++--------------- src/pages/blog/entrycard.rs | 50 +++---- src/pages/blog/mod.rs | 7 +- src/pages/blog/navigation.rs | 213 ------------------------------ src/pages/not_found.rs | 16 ++- src/pages/projects.rs | 56 ++++---- 14 files changed, 297 insertions(+), 745 deletions(-) delete mode 100644 src/pages/blog/navigation.rs diff --git a/.gitignore b/.gitignore index bd6126c..e18998b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist/ pkg/ target/ Cargo.lock +static/ diff --git a/Cargo.toml b/Cargo.toml index 05ee636..30e4027 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,8 @@ log = { version = "0.4" } wasm-logger = { version = "0.2" } serde = { version = "1.0" } +wasm-bindgen-futures = "0.4.50" +serde_json = "1.0.143" [dependencies.web-sys] version = "0.3" diff --git a/src/main.rs b/src/main.rs index 5ad6393..378242d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,14 +85,46 @@ impl Component for App { z-index: 0 !important; " ref={self.node_ref.clone()} /> +
+

{r"-»{ "}

+ to={Route::About}> + {r"about"} + > + /*

{r"."}

+ to={Route::Entries}> + {r"blog"} + >*/ +

{r"."}

+ to={Route::FindMe}> + {r"findme"} + > +

{r"."}

+ to={Route::Projects}> + {r"projects"} + > +

{r" }«-"}

+
- - + /* + min-height: 70vh !important; + height: 80vw !important; + */
render={switch} />
+ max-width: calc(100vw - 18px) !important; + height: 100% !important; + margin-top: auto !important; + margin-bottom: auto !important; + scrollbar-width: thin !important; + scrollbar-color: transparent transparent !important; + "> render={switch} /> + {self.view_buttons()} +
@@ -170,13 +187,13 @@ fn switch(routes: Route) -> Html { html! { } } Route::Entry { id } => { - html! { } + html! { } } Route::Authors => { html! { } } Route::Author { id } => { - html! { } + html! { } } Route::FindMe => { @@ -193,88 +210,79 @@ fn switch(routes: Route) -> Html { } impl App { - fn view_list(&self, _ctx: &Context) -> Html { - html! {} - } - fn view_buttons(&self) -> Html { html! { - <> -
-
- iouring - wasm - servfail - dataforest - fedora - artix - nixos - void - void - rust - csharp - kotlin - java - aqueer -
-
- +
+ iouring + wasm + servfail + dataforest + fedora + artix + nixos + void + void + rust + csharp + kotlin + java + aqueer +
} } diff --git a/src/pages/blog/author.rs b/src/pages/blog/author.rs index 642b5b6..5abb7fd 100644 --- a/src/pages/blog/author.rs +++ b/src/pages/blog/author.rs @@ -1,10 +1,10 @@ -use yew::prelude::*; use crate::pages::blog::content; use crate::pages::blog::content::BlogEntry; +use yew::prelude::*; #[derive(Clone, Debug, Eq, PartialEq, Properties)] pub struct Props { - pub seed: u8, + pub id: u8, } pub struct Author { @@ -15,68 +15,33 @@ impl Component for Author { type Properties = Props; fn create(ctx: &Context) -> Self { - Self { author: content::Author::from_seed(ctx.props().seed), } + Self { + author: content::Author::from_id(ctx.props().id), + } } fn changed(&mut self, ctx: &Context, _old_props: &Self::Properties) -> bool { - self.author = content::Author::from_seed(ctx.props().seed); + self.author = content::Author::from_id(ctx.props().id); true } fn view(&self, _ctx: &Context) -> Html { let Self { author } = self; html! { -
- insert pfp here -
-

{author.name.clone()}

-

+

+ insert pfp here +
+

{author.name.clone()}

+

{ for author.keywords.iter().map(|tag| html! {

{ tag }

}) }


-

{r#"about me"#}

-
+

{r#"about me"#}

+
{ author.about.clone() }
} } } - - /* -
-
-
-
-

{ &author.name }

-
-
-
-
-
-

{ "Interests" }

-
- { for author.keywords.iter().map(|tag| html! { { tag } }) } -
-
-
-
-
- The author's profile picture. -
-
-
-
-
-

{ "About me" }

-
- { author.about.clone() } -
-
-
-
-
-
-
- */ \ No newline at end of file diff --git a/src/pages/blog/authorcard.rs b/src/pages/blog/authorcard.rs index b2f7beb..51a7e6e 100644 --- a/src/pages/blog/authorcard.rs +++ b/src/pages/blog/authorcard.rs @@ -1,14 +1,14 @@ use yew::prelude::*; use yew_router::components::Link; -use crate::pages::blog::content::BlogEntry; use crate::pages::blog::content::Author; +use crate::pages::blog::content::BlogEntry; use crate::Route; #[derive(Clone, Debug, PartialEq, Eq, Properties)] pub struct PropsAuthorCard { - pub seed: u8, + pub id: u8, } pub struct AuthorCard { @@ -20,11 +20,13 @@ impl Component for AuthorCard { type Properties = PropsAuthorCard; fn create(ctx: &Context) -> Self { - Self { author: Author::from_seed(ctx.props().seed), } + Self { + author: Author::from_id(ctx.props().id), + } } fn changed(&mut self, ctx: &Context, _old_props: &Self::Properties) -> bool { - self.author = Author::from_seed(ctx.props().seed); + self.author = Author::from_id(ctx.props().id); true } @@ -32,16 +34,16 @@ impl Component for AuthorCard { let Self { author } = self; html! { <> -
-
-
-
-
+
+
+
+
+
this should normally show an image mew,,
-
-

{ &author.name }

+
+

{ &author.name }

{ "I like " } { author.keywords.join(", ") } @@ -49,8 +51,8 @@ impl Component for AuthorCard {

-