diff --git a/app/src/components/article.rs b/app/src/components/article.rs
index 31e3a5e..4f8e4a1 100644
--- a/app/src/components/article.rs
+++ b/app/src/components/article.rs
@@ -14,7 +14,7 @@ pub struct ArticleData {
pub fn ArticleBuilder() -> impl IntoView {
let data_resource = create_local_resource(
|| (),
- |_| async move { slingshot("./public/articles".to_string()).await },
+ |_| async move { slingshot("./public/blog".to_string()).await },
);
let articles_view = move || {
diff --git a/app/src/components/slingshot.rs b/app/src/components/slingshot.rs
index e71d724..83fc3cc 100644
--- a/app/src/components/slingshot.rs
+++ b/app/src/components/slingshot.rs
@@ -13,42 +13,36 @@ struct ArticleFrontmatter {
pub async fn slingshot(path: String) -> Result, ServerFnError> {
let mut articles = vec![];
- for dir in std::fs::read_dir(path)? {
- for file in std::fs::read_dir(dir?.path())? {
- let fileinfo = file?;
- let filepath = fileinfo.path();
+ for file in std::fs::read_dir(path)? {
+ let fileinfo = file?;
+ let filepath = fileinfo.path();
- if let Some(filetype) = filepath.extension() {
- if filetype == "md" {
- let file = std::fs::read_to_string(filepath)?;
- let html_from_md =
- femark::process_markdown_to_html_with_frontmatter(&file.to_string(), true)
- .expect("Problem processing markdown");
- let content = html_from_md.content;
- let _toc = html_from_md.toc;
+ if let Some(filetype) = filepath.extension() {
+ if filetype == "md" {
+ let file = std::fs::read_to_string(filepath)?;
+ let html_from_md =
+ femark::process_markdown_to_html_with_frontmatter(&file.to_string(), true)
+ .expect("Problem processing markdown");
+ let content = html_from_md.content;
+ let _toc = html_from_md.toc;
- if let Some(front_raw) = html_from_md.frontmatter {
- if let Some(front_code) = front_raw.code_block {
- let toml: ArticleFrontmatter =
- toml::from_str(&front_code.source)?;
+ if let Some(front_raw) = html_from_md.frontmatter {
+ if let Some(front_code) = front_raw.code_block {
+ let toml: ArticleFrontmatter = toml::from_str(&front_code.source)?;
- articles.push(ArticleData {
- content_type: toml.content_type,
- title: toml.title,
- date: toml.date,
- content,
- })
- }
+ println!("{} {}", &toml.date, &toml.title);
+ articles.push(ArticleData {
+ content_type: toml.content_type,
+ title: toml.title,
+ date: toml.date,
+ content,
+ })
}
}
}
}
}
- // Simulate lag
- // use std::thread::sleep;
- // use std::time::Duration;
- // sleep(Duration::from_millis(300));
-
+ println!("iran");
Ok(articles)
}
diff --git a/app/src/lib.rs b/app/src/lib.rs
index 472d5c8..779d9f6 100644
--- a/app/src/lib.rs
+++ b/app/src/lib.rs
@@ -8,8 +8,7 @@ pub mod components;
pub mod error_template;
pub mod routes;
-// use crate::routes::{blog::*, home::*, projects::*};
-use crate::routes::home::Home;
+use crate::routes::{blog::Blog, home::Home, projects::Projects};
#[component]
pub fn App() -> impl IntoView {
@@ -47,8 +46,8 @@ pub fn App() -> impl IntoView {
- //
- //
+
+
diff --git a/app/src/routes.rs b/app/src/routes.rs
index 509f52f..a28ef14 100644
--- a/app/src/routes.rs
+++ b/app/src/routes.rs
@@ -1,3 +1,3 @@
pub mod home;
-// pub mod blog;
-// pub mod projects;
+pub mod blog;
+pub mod projects;
diff --git a/app/src/routes/blog.rs b/app/src/routes/blog.rs
index 9a4b7d5..d95e782 100644
--- a/app/src/routes/blog.rs
+++ b/app/src/routes/blog.rs
@@ -1,7 +1,20 @@
use crate::components::article::*;
+use crate::components::slingshot::*;
+use crate::error_template::*;
use leptos::*;
-#[component]
+#[island]
pub fn Blog() -> impl IntoView {
- view! { }
+
+ view! {
+ "Loading..."
}
+ }>
+ }
+ }>
+
+
+
+ }
}
diff --git a/app/src/routes/home.rs b/app/src/routes/home.rs
index 95cf032..9015acd 100644
--- a/app/src/routes/home.rs
+++ b/app/src/routes/home.rs
@@ -3,7 +3,7 @@ use crate::components::slingshot::*;
use crate::error_template::*;
use leptos::*;
-#[island]
+#[component]
pub fn Home() -> impl IntoView {
view! {
@@ -13,7 +13,7 @@ pub fn Home() -> impl IntoView {
}
}>
-
+ "Hello again"
}
diff --git a/app/src/routes/projects.rs b/app/src/routes/projects.rs
index 7169efa..b5e6912 100644
--- a/app/src/routes/projects.rs
+++ b/app/src/routes/projects.rs
@@ -1,7 +1,20 @@
-use crate::components::article::*;
+// use crate::components::article::*;
+// use crate::components::slingshot::*;
+use crate::error_template::*;
use leptos::*;
#[component]
pub fn Projects() -> impl IntoView {
- view! { }
+
+ view! {
+ "Loading..."
}
+ }>
+ }
+ }>
+ "Projects"
+
+
+ }
}
diff --git a/public/articles/bots/cartman.html b/public/articles/bots/cartman.html
deleted file mode 100644
index 2755d2d..0000000
--- a/public/articles/bots/cartman.html
+++ /dev/null
@@ -1 +0,0 @@
-cartman
diff --git a/public/articles/games/index.html b/public/articles/games/index.html
deleted file mode 100644
index 68a671e..0000000
--- a/public/articles/games/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
-Some games using wasm/webgl
-Browser performance as of January 2023
-Tested better:
-
- - Opera
- - Firefox Developer Edition
- - Brave
-
-Tested poor or broken:
-
- - Safari
- - Chrome stable release or older
- - Edge, see above^
-
-Consider anything else average or let me know otherwise
-
- ---MY GAMES---
- - adam - The first. Unity Demo/Tutorial with some mods
- - multiplayer fps - Dive into netcode with Godot (Open two, invite
- your friends!)
- - snek - Canvas + JS (the actual first)
- - balls - Godot demo engine test
-
diff --git a/public/articles/blog/20220207-swim.md b/public/blog/20220207-swim.md
similarity index 99%
rename from public/articles/blog/20220207-swim.md
rename to public/blog/20220207-swim.md
index b802d96..43fa047 100644
--- a/public/articles/blog/20220207-swim.md
+++ b/public/blog/20220207-swim.md
@@ -1,6 +1,6 @@
```toml
content_type = "blog"
-title = "Hume"
+title = "Swim"
date = "2022 2 7"
```
diff --git a/public/articles/blog/20220506-change.md b/public/blog/20220506-change.md
similarity index 100%
rename from public/articles/blog/20220506-change.md
rename to public/blog/20220506-change.md
diff --git a/public/articles/blog/20220520-nvidia.md b/public/blog/20220520-nvidia.md
similarity index 100%
rename from public/articles/blog/20220520-nvidia.md
rename to public/blog/20220520-nvidia.md
diff --git a/public/articles/games/snek.md b/public/blog/20220520-snek.md
similarity index 100%
rename from public/articles/games/snek.md
rename to public/blog/20220520-snek.md
diff --git a/public/articles/projects/20220529-housing.md b/public/blog/20220529-housing.md
similarity index 100%
rename from public/articles/projects/20220529-housing.md
rename to public/blog/20220529-housing.md
diff --git a/public/articles/blog/20220602-back.md b/public/blog/20220602-back.md
similarity index 100%
rename from public/articles/blog/20220602-back.md
rename to public/blog/20220602-back.md
diff --git a/public/articles/projects/20220614-reddit.md b/public/blog/20220614-reddit.md
similarity index 99%
rename from public/articles/projects/20220614-reddit.md
rename to public/blog/20220614-reddit.md
index 92bcc7d..2de45ca 100644
--- a/public/articles/projects/20220614-reddit.md
+++ b/public/blog/20220614-reddit.md
@@ -1,7 +1,7 @@
```toml
content_type = "project"
title = "What goes into a successful Reddit post?"
-date = "2022 6 16"
+date = "2022 6 14"
```
In an attempt to find out what about a Reddit post makes it successful I will use some
diff --git a/public/articles/blog/20220701-progress.md b/public/blog/20220701-progress.md
similarity index 100%
rename from public/articles/blog/20220701-progress.md
rename to public/blog/20220701-progress.md
diff --git a/public/articles/games/adam.md b/public/blog/20220911-adam.md
similarity index 100%
rename from public/articles/games/adam.md
rename to public/blog/20220911-adam.md
diff --git a/public/articles/games/balls.md b/public/blog/20220913-balls.md
similarity index 100%
rename from public/articles/games/balls.md
rename to public/blog/20220913-balls.md
diff --git a/public/articles/games/fps.md b/public/blog/20221009-fps.md
similarity index 100%
rename from public/articles/games/fps.md
rename to public/blog/20221009-fps.md
diff --git a/public/articles/projects/20221020-cartman.md b/public/blog/20221020-cartman.md
similarity index 100%
rename from public/articles/projects/20221020-cartman.md
rename to public/blog/20221020-cartman.md
diff --git a/public/articles/projects/20230427-lightning.md b/public/blog/20230427-lightning.md
similarity index 100%
rename from public/articles/projects/20230427-lightning.md
rename to public/blog/20230427-lightning.md