Added some SEO and ran cargo update

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
cicd
Tuan-Dat Tran 2024-08-30 18:11:23 +02:00
parent b7a47ca903
commit 0ff5419c23
5 changed files with 366 additions and 341 deletions

625
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "athome" name = "athome"
version = "0.2.1" version = "0.2.2"
authors = ["Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>"] authors = ["Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>"]
edition = "2021" edition = "2021"
@ -8,7 +8,6 @@ edition = "2021"
[dependencies] [dependencies]
serde = { version = "1.0.197", features = ["derive"] } serde = { version = "1.0.197", features = ["derive"] }
dioxus = { version = "0.5", features = ["fullstack", "router"] } dioxus = { version = "0.5", features = ["fullstack", "router"] }
# Debug # Debug

View File

@ -21,6 +21,19 @@ pub fn P(props: PProps) -> Element {
} }
} }
#[component]
pub fn Title(props: PProps) -> Element {
rsx! {
div {
class: "{props.class}",
h1 {
class: "mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white",
{props.children}
}
}
}
}
#[component] #[component]
pub fn H1(props: PProps) -> Element { pub fn H1(props: PProps) -> Element {
rsx! { rsx! {
@ -84,7 +97,7 @@ pub fn Card(prop: CardProp) -> Element {
Picture {src: "{prop.picture}"}, Picture {src: "{prop.picture}"},
} }
} }
H5 { "{prop.name}", span { class: "text-grey-600 dark:text-grey-500 text-lg", " {prop.gender}" } }, Title { "{prop.name}", span { class: "text-grey-600 dark:text-grey-500 text-lg", " {prop.gender}" } },
{ prop.children } { prop.children }
} }
} }

View File

@ -1,7 +1,7 @@
use dioxus::prelude::*; use dioxus::prelude::*;
mod footer; pub mod footer;
mod header; pub mod header;
use crate::{Body, Route}; use crate::{Body, Route};
use footer::Footer; use footer::Footer;
@ -9,17 +9,13 @@ use header::Header;
pub fn Layout() -> Element { pub fn Layout() -> Element {
rsx! { rsx! {
meta {
name: "description",
content: "Explore Tuan-Dat Tran's personal website featuring his CV, publications, projects, and consulting services. Get insights into his professional journey and connect for collaboration opportunities.",
}
div { div {
class: "flex flex-col min-h-screen" , class: "flex flex-col min-h-screen",
Header {}, Header {},
Body { Body {
Outlet::<Route> {}, Outlet::<Route> {},
}
Footer {}, Footer {},
}
} }
} }
} }

View File

@ -2,9 +2,12 @@
use std::str::FromStr; use std::str::FromStr;
use components::H1;
use dioxus::prelude::*; use dioxus::prelude::*;
use dioxus_sdk::i18n::*; use dioxus_sdk::i18n::*;
use layout::footer::Footer;
use layout::header::Header;
use tracing::Level; use tracing::Level;
pub mod components; pub mod components;
@ -60,6 +63,41 @@ fn App() -> Element {
}); });
rsx! { rsx! {
meta {
name: "description",
content: "Visit Tuan-Dat Tran's website for his CV, publications, projects, and consulting services. Connect for collaboration.",
},
script {
r#type: "application/ld+json",
"
{{
\"@context\": \"https://schema.org\",
\"@type\": \"ProfilePage\",
\"mainEntity\": {{
\"@type\": \"Person\",
\"name\": \"Tuan-Dat Tran\",
\"alternateName\": \"TuDatTr\",
\"image\": \"https://www.tudattr.dev/pictures/headshot.webp\",
}}
}}
"
}
// meta {
// property: "og:title",
// content: "Tuan-Dat Trans Personal Website",
// }
// meta {
// property: "og:description",
// content: "Explore Tuan-Dat Tran's personal website featuring his CV, publications, projects, and consulting services. Get insights into his professional journey and connect for collaboration opportunities.",
// }
// meta {
// property: "og:image",
// content: "https://www.tudattr.dev/pictures/headshot.webp",
// }
// meta {
// property: "og:url",
// content: "https://tudattr.dev",
// }
div { div {
class: "bg-white dark:bg-gray-900 min-h-screen", class: "bg-white dark:bg-gray-900 min-h-screen",
Router::<Route> {}, Router::<Route> {},
@ -71,12 +109,16 @@ fn App() -> Element {
fn PageNotFound(route: Vec<String>) -> Element { fn PageNotFound(route: Vec<String>) -> Element {
rsx! { rsx! {
div { div {
class: "h-screen items-center justify-center", class: "flex flex-col min-h-screen items",
img { Header {},
class: "size-auto", div {
src: "https://raw.githubusercontent.com/SAWARATSUKI/ServiceLogos/main/404Notfound/NotFound.png" class: "container mx-auto p-4 flex items-center justify-center max-w-md w-full",
H1 {
"Site not found (404)"
},
} }
} Footer {}
},
} }
} }