From 42199ecc1869e6b0b3aee46733516ef1f3757d75 Mon Sep 17 00:00:00 2001 From: 404salad <404salad@gmail.com> Date: Fri, 20 Sep 2024 02:55:24 +0530 Subject: [PATCH] set up cleaner urls maybe add shorter url paths somehow --- dist/articles/{Cronjobs.html => Cronjobs} | 2 +- ...B.html => Debugging C++ Programs with GDB} | 2 +- ...Should Watch Conference Talks on YouTube} | 2 +- .../{Makefiles:).html => Makefiles:)} | 2 +- dist/articles/{On Logging.html => On Logging} | 2 +- dist/articles/{image.html => image} | 2 +- dist/home | 54 +++++++++++++++++++ dist/index.html | 12 ++--- src/consolidate_into_homepage.rs | 4 +- src/main.rs | 2 +- src/parse_one_article.rs | 8 +-- 11 files changed, 73 insertions(+), 19 deletions(-) rename dist/articles/{Cronjobs.html => Cronjobs} (98%) rename dist/articles/{Debugging C++ Programs with GDB.html => Debugging C++ Programs with GDB} (98%) rename dist/articles/{Every Programmer Should Watch Conference Talks on YouTube.html => Every Programmer Should Watch Conference Talks on YouTube} (98%) rename dist/articles/{Makefiles:).html => Makefiles:)} (98%) rename dist/articles/{On Logging.html => On Logging} (97%) rename dist/articles/{image.html => image} (99%) create mode 100644 dist/home diff --git a/dist/articles/Cronjobs.html b/dist/articles/Cronjobs similarity index 98% rename from dist/articles/Cronjobs.html rename to dist/articles/Cronjobs index fed1298..1987197 100644 --- a/dist/articles/Cronjobs.html +++ b/dist/articles/Cronjobs @@ -8,7 +8,7 @@ Cronjobs -home +home

Cronjobs


diff --git a/dist/articles/Debugging C++ Programs with GDB.html b/dist/articles/Debugging C++ Programs with GDB similarity index 98% rename from dist/articles/Debugging C++ Programs with GDB.html rename to dist/articles/Debugging C++ Programs with GDB index b0e591d..da7bfd6 100644 --- a/dist/articles/Debugging C++ Programs with GDB.html +++ b/dist/articles/Debugging C++ Programs with GDB @@ -8,7 +8,7 @@ Debugging C++ Programs with GDB -home +home

Debugging C++ Programs with GDB


If you don’t use GDB but program in C/C++, you are missing out on a powerful debugging tool. Here’s a quick 5-minute tutorial to get you started.

diff --git a/dist/articles/Every Programmer Should Watch Conference Talks on YouTube.html b/dist/articles/Every Programmer Should Watch Conference Talks on YouTube similarity index 98% rename from dist/articles/Every Programmer Should Watch Conference Talks on YouTube.html rename to dist/articles/Every Programmer Should Watch Conference Talks on YouTube index 00f70e8..9c0a80d 100644 --- a/dist/articles/Every Programmer Should Watch Conference Talks on YouTube.html +++ b/dist/articles/Every Programmer Should Watch Conference Talks on YouTube @@ -8,7 +8,7 @@ Every Programmer Should Watch Conference Talks on YouTube -home +home

Every Programmer Should Watch Conference Talks on YouTube


I was going to write a longer article to convince everyone to watch the conferences but Its much better to give a summary of my favorite talks and hopefully that will be persuasive enough~

diff --git a/dist/articles/Makefiles:).html b/dist/articles/Makefiles:) similarity index 98% rename from dist/articles/Makefiles:).html rename to dist/articles/Makefiles:) index 528249f..8250708 100644 --- a/dist/articles/Makefiles:).html +++ b/dist/articles/Makefiles:) @@ -8,7 +8,7 @@ Makefiles:) -home +home

Makefiles:)


Quick and Easy Makefile Guide

diff --git a/dist/articles/On Logging.html b/dist/articles/On Logging similarity index 97% rename from dist/articles/On Logging.html rename to dist/articles/On Logging index bd7c8a8..f62e464 100644 --- a/dist/articles/On Logging.html +++ b/dist/articles/On Logging @@ -8,7 +8,7 @@ On Logging -home +home

On Logging


diff --git a/dist/articles/image.html b/dist/articles/image similarity index 99% rename from dist/articles/image.html rename to dist/articles/image index 4e9ddc5..350dacb 100644 --- a/dist/articles/image.html +++ b/dist/articles/image @@ -8,7 +8,7 @@ image -home +home

image


Hello World

diff --git a/dist/home b/dist/home new file mode 100644 index 0000000..f9eae8d --- /dev/null +++ b/dist/home @@ -0,0 +1,54 @@ + + + + + 404salad + + + + + +
+

404salad +

+
sahil +
+ +
+
+
+
+ + \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 1cd168a..f9eae8d 100644 --- a/dist/index.html +++ b/dist/index.html @@ -37,17 +37,17 @@
sahil

diff --git a/src/consolidate_into_homepage.rs b/src/consolidate_into_homepage.rs index c448336..896a559 100644 --- a/src/consolidate_into_homepage.rs +++ b/src/consolidate_into_homepage.rs @@ -39,7 +39,7 @@ pub fn read_directory_content() -> Vec { pub fn create_homepage(user_config: &config::UserConfig) -> std::io::Result<()> { let article_names = read_directory_content(); - let output_path = String::from("dist/index.html"); + let output_path = String::from("dist/home"); let mut document = String::new(); document.push_str(&format!( @@ -85,7 +85,7 @@ pub fn create_homepage(user_config: &config::UserConfig) -> std::io::Result<()> for article_name in article_names { document.push_str(&format!( "", article_name = article_name )); diff --git a/src/main.rs b/src/main.rs index 083f959..b31ce01 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,7 @@ fn main() { match consolidate_into_homepage::create_homepage(&user_config) { Ok(_) => { - println!("added all blogs to homepage, view in dist/index.html") + println!("added all blogs to homepage, view in dist/home") } Err(e) => { eprintln!("unsuccesful in creating homepage {}", e) diff --git a/src/parse_one_article.rs b/src/parse_one_article.rs index 211f753..37ae205 100644 --- a/src/parse_one_article.rs +++ b/src/parse_one_article.rs @@ -36,7 +36,7 @@ fn wrap_html(markdown_output: &str, article: &str, _user_config: &config::UserCo {article} -home +home

{article}


" @@ -48,16 +48,16 @@ fn wrap_html(markdown_output: &str, article: &str, _user_config: &config::UserCo wrapped_html } -/// convert a single .md file to html +// convert a single .md file to html pub fn markdown_to_styled_html( article: &str, user_config: &config::UserConfig, ) -> std::io::Result<()> { println!("parsing - {article}"); let mut input_path = String::from("content/") + &article.to_owned(); - let mut output_path = String::from("dist/articles/") + &article.to_owned(); + let output_path = String::from("dist/articles/") + &article.to_owned(); input_path.push_str(".md"); - output_path.push_str(".html"); + //output_path.push_str(".html"); let html_from_md = parse_markdown(&read_markdown(input_path)?); let mut file = File::create(output_path)?; let wrapped_html = wrap_html(&html_from_md, article, user_config);