feat(master): version 2.0.2, changed to use articles in blogs, as well as many other things I do not remember

This commit is contained in:
2025-06-03 22:52:11 -06:00
parent 5e52c6dea1
commit c14501061f
10 changed files with 76 additions and 31 deletions

2
Cargo.lock generated
View File

@ -3179,7 +3179,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "personal_site"
version = "2.0.1"
version = "2.0.2"
dependencies = [
"dioxus",
"reqwest",

View File

@ -1,6 +1,6 @@
[package]
name = "personal_site"
version = "2.0.1"
version = "2.0.2"
authors = ["darkicewolf50 <brock.tomlinson@ucalgary.ca>"]
edition = "2021"

2
assets/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /blogs/

View File

@ -8,6 +8,14 @@
flex-direction: column;
}
#blog_info ul {
display: flex;
flex-direction: row;
list-style-type: none;
margin: 0px;
padding: 0px;
}
#blog_info p {
padding: 2svh 0svw;
margin: 0px;
@ -17,6 +25,7 @@
padding: 1svh 1svw;
margin: 2svh 0svw;
margin-bottom: 0px;
font-size: 2em;
}
#blog_info div {
@ -40,7 +49,7 @@
#blog_info div p:last-child {
margin-right: 10svh;
}
#blog_info div div p {
#blog_info div ul li {
background-color: rgba(128, 0, 128, 0.2);
border-radius: 1rem;
padding: 0.25svh 8px;

View File

@ -2,8 +2,8 @@
//! They can be used to defined common UI elements like buttons, forms, and modals. In this template, we define a Hero
//! component to be used in our app.
mod hero;
pub use hero::Hero;
// mod hero;
// pub use hero::Hero;
mod techs;
pub use techs::TechCat;

View File

@ -1,7 +1,7 @@
use dioxus::prelude::*;
// use components::Hero;
use views::{Blog, Blogs, ContactMe, Home, Navbar, NewHome, Projects};
use views::{Blog, Blogs, ContactMe, Home, Navbar, Projects};
/// Define a components module that contains all shared components for our app.
mod components;
@ -42,8 +42,8 @@ pub enum Route {
#[route("/contact")]
ContactMe {},
#[route("/new_home")]
NewHome {},
// #[route("/new_home")]
// NewHome {},
// PageNotFound is a catch all route that will match any route and placing the matched segments in the route field
#[route("/:..route")]
PageNotFound { route: Vec<String> },

View File

@ -29,7 +29,8 @@ pub fn Blog(blog_title: String) -> Element {
rsx! {
document::Stylesheet { href: asset!("/assets/styling/blog.css") }
document::Title { "Brock Tomlinson - {blog_title.clone()}" }
document::Meta { name: "author", content: "Brock Tomlinson" }
// document::Meta { name: "author", content: "Brock Tomlinson" }
document::Meta { name: "robots", content: "noindex, nofollow" }
div { id: "blog",
@ -52,20 +53,22 @@ pub fn Blog(blog_title: String) -> Element {
// span { " <---> " }
Link { to: Route::Blogs { page_num: 0 }, "Go Back" }
if let Some(blog_content) = &*blog_resource.read() {
div { id: "blog_info",
h1 { "{blog_content.blog_title}" }
div {
article {
header { id: "blog_info",
h1 { "{blog_content.blog_title}" }
div {
for tag in &blog_content.tags {
p { "{tag}" }
ul {
for tag in &blog_content.tags {
li { "{tag}" }
}
}
p { "{&blog_content.date_last_edit}" }
}
p { "{&blog_content.date_last_edit}" }
}
}
div {
id: "blog_content",
dangerous_inner_html: *&blog_content.html_blog_content.as_str(),
section {
id: "blog_content",
dangerous_inner_html: *&blog_content.html_blog_content.as_str(),
}
}
} else {
p { "Loading..." }
@ -78,7 +81,7 @@ async fn get_blog(blog_name: String) -> Result<BlogContent, reqwest::Error> {
let client = reqwest::Client::new();
let res = client
.get(format!("/blogs/blog/{}", blog_name))
.get(format!("blogs/blog/{}", blog_name))
.timeout(std::time::Duration::from_secs(10))
.send()
.await?
@ -128,8 +131,9 @@ pub fn Blogs(page_num: u32) -> Element {
rsx! {
document::Stylesheet { href: asset!("/assets/styling/blog.css") }
document::Meta { name: "robots", content: "noindex, nofollow" }
document::Title { "Brock Tomlinson - Blogs" }
div { id: "blogs",
document::Title { "Brock Tomlinson - Blogs" }
div { id: "blogs-title",
h1 { "Blogs" }
p {

View File

@ -1,5 +1,4 @@
use crate::components::{Experience, TechCat};
use crate::helper_fun::set_meta_tags;
use crate::views::{Contact, Projects};
use crate::Route;
use dioxus::prelude::*;
@ -33,13 +32,6 @@ pub fn Home() -> Element {
rsx!(
document::Title { "Brock Tomlinson - Home" }
document::Stylesheet { href: asset!("/assets/styling/home.css") }
set_meta_tags {
description: "a fourth year Software Engineering Student specializing in full-stack development with a strong focus on backend technologies.
I am developing the language of how to design, develop, and create programs that are to industry standards and reasonably efficent.
I bring the lessons learned from each project I have completed,
learning from the mistakes I have made and bringing improved versions forward into the next project.",
keywords: "webdev Rust software engineer projects blog darkicewol50",
}
div {
div { id: "home-intro",
h1 { "Hi I'm Brock" }

View File

@ -8,8 +8,8 @@
//! The [`Navbar`] component will be rendered on all pages of our app since every page is under the layout. The layout defines
//! a common wrapper around all child routes.
mod new_home;
pub use new_home::NewHome;
// mod new_home;
// pub use new_home::NewHome;
mod blog;
pub use blog::{Blog, Blogs};

View File

@ -1,7 +1,11 @@
use crate::components::Ender;
use crate::helper_fun::set_meta_tags;
use crate::Route;
use dioxus::prelude::*;
const _ROBOTS_TXT: Asset = asset!("/assets/robots.txt");
const PROFESSIONAL_PHOTO_JPG: Asset = asset!("assets/professional_photo_2023.jpg");
/// The Navbar component that will be rendered on all pages of our app since every page is under the layout.
///
///
@ -9,9 +13,43 @@ use dioxus::prelude::*;
/// routes will be rendered under the outlet inside this component
#[component]
pub fn Navbar() -> Element {
let PHOTO_FORMAT_URL = format!("https://darkicewolf50.pages.dev{PROFESSIONAL_PHOTO_JPG}");
rsx! {
document::Stylesheet { href: asset!("/assets/styling/navbar.css") }
document::Stylesheet { href: asset!("assets/styling/standardColoursandFonts.css") }
set_meta_tags {
description: "Fourth year Software Engineering student specializing in full-stack development with a backend focus. Always improving through experience.",
keywords: "webdev Rust software engineer projects blog darkicewol50",
}
document::Meta { name: "robots", content: "index, follow" }
document::Link { rel: "canonical", href: "https://darkicewolf50.pages.dev/" }
document::Meta {
name: "google-site-verification",
content: "lsAs9c2Pv7c6Sm26z1hd2YqR2depbp4sJddIDYKHkxY",
}
document::Meta {
property: "og:title",
content: "Brock Tomlinson - Software Engineering Student",
}
document::Meta {
property: "og:description",
content: "Fourth year Software Engineering student specializing in full-stack development with a backend focus. Always improving through experience.",
}
document::Meta { property: "og:type", content: "website" }
document::Meta { property: "og:url", content: "https://darkicewolf50.pages.dev/" }
document::Meta { name: "twitter:card", content: "summary_large_image" }
document::Meta {
name: "twitter:title",
content: "Brock Tomlinson - Software Engineer",
}
document::Meta {
name: "twitter:description",
content: "Fourth year Software Engineering student specializing in full-stack development with a backend focus. Always improving through experience.",
}
document::Meta { name: "twitter:image", content: PHOTO_FORMAT_URL.clone() }
document::Meta { property: "og:image", content: PHOTO_FORMAT_URL.clone() }
div { id: "navbar",
Link { to: Route::Home {}, "Home" }