wowzers
This commit is contained in:
parent
b0168c05be
commit
ac5cba1c4d
8 changed files with 19 additions and 17 deletions
|
|
@ -1 +0,0 @@
|
||||||
What a good day!
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
This was tough, good I have my pikmin plush.
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
## This is huge
|
|
||||||
We have infrastructure set up for a brighter future. Game on gamers!
|
|
||||||
|
|
||||||
// Raka
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Just some normal text!
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
title: Crazy Hamburger
|
|
||||||
author: Banana Farm
|
|
||||||
pubDate: Tue, 12 Mar 2024 16:53:47 GMT
|
|
||||||
---
|
|
||||||
😎 I don't like loosing.
|
|
||||||
|
|
||||||
8
blogs/day6.md
Normal file
8
blogs/day6.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
title: Cute
|
||||||
|
author: Rakarake
|
||||||
|
pubDate: Fri, Mar 27 2026
|
||||||
|
---
|
||||||
|
Warframe.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
5
blogs/day7.md
Normal file
5
blogs/day7.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
title: A statement
|
||||||
|
author: Rakarake
|
||||||
|
pubDate: Fri, Mar 27 2026
|
||||||
|
---
|
||||||
|
Kyuuuuuuu! 🐳
|
||||||
10
src/main.rs
10
src/main.rs
|
|
@ -34,7 +34,7 @@ fn main() -> io::Result<()> {
|
||||||
let mut channel = Channel::default();
|
let mut channel = Channel::default();
|
||||||
channel.title = "MDF blog huge".to_string();
|
channel.title = "MDF blog huge".to_string();
|
||||||
channel.link = "https://mdf.farm".to_string();
|
channel.link = "https://mdf.farm".to_string();
|
||||||
channel.description = "morbius text wow".to_string();
|
channel.description = "The MDF blog".to_string();
|
||||||
channel.generator = Some("Rakabaka's tooling".to_string());
|
channel.generator = Some("Rakabaka's tooling".to_string());
|
||||||
channel.items = posts.iter().map(|(body, metadata)| {
|
channel.items = posts.iter().map(|(body, metadata)| {
|
||||||
let guid = metadata.get("guid").map(|guid|
|
let guid = metadata.get("guid").map(|guid|
|
||||||
|
|
@ -58,7 +58,9 @@ fn main() -> io::Result<()> {
|
||||||
let guid = metadata.get("guid").unwrap_or(&i.to_string()).clone();
|
let guid = metadata.get("guid").unwrap_or(&i.to_string()).clone();
|
||||||
let title = metadata.get("title").map(|title| format!("<h1>{title}</h1>")).unwrap_or("".to_string());
|
let title = metadata.get("title").map(|title| format!("<h1>{title}</h1>")).unwrap_or("".to_string());
|
||||||
let pub_date = metadata.get("pubDate").map(|pub_date| format!("<i>{pub_date}</i>")).unwrap_or("".to_string());
|
let pub_date = metadata.get("pubDate").map(|pub_date| format!("<i>{pub_date}</i>")).unwrap_or("".to_string());
|
||||||
format!("<div class=\"blogpost\" id={guid}>{title}{body}{pub_date}</div>")
|
let author = metadata.get("author").map(|author| format!("<i>{author}</i>")).unwrap_or("".to_string());
|
||||||
|
|
||||||
|
format!("<div class=\"blogpost\" id={guid}>{title}{body}<p>{author} - {pub_date}</p></div>")
|
||||||
}).collect::<Vec<String>>().concat())
|
}).collect::<Vec<String>>().concat())
|
||||||
},
|
},
|
||||||
"new" => {
|
"new" => {
|
||||||
|
|
@ -70,9 +72,9 @@ fn main() -> io::Result<()> {
|
||||||
let mut author = String::new();
|
let mut author = String::new();
|
||||||
io::stdin().read_line(&mut author).unwrap();
|
io::stdin().read_line(&mut author).unwrap();
|
||||||
|
|
||||||
let pub_date = chrono::Utc::now();
|
let pub_date = chrono::Utc::now().format("%a, %b %e %Y");
|
||||||
|
|
||||||
print!("title: {title}author: {author}pubDate: {pub_date}");
|
print!("title: {title}author: {author}pubDate: {pub_date}\n---\n");
|
||||||
},
|
},
|
||||||
_ => eprintln!("need to specify 'rss', 'html' or 'new'"),
|
_ => eprintln!("need to specify 'rss', 'html' or 'new'"),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue