wow
This commit is contained in:
parent
9b61bc1292
commit
8c7128591f
2 changed files with 4 additions and 1 deletions
1
blogs/day4.md
Normal file
1
blogs/day4.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Just some normal text!
|
||||
|
|
@ -19,17 +19,19 @@ fn main() -> io::Result<()> {
|
|||
channel.items = posts.iter().enumerate().map(|(i, p)| {
|
||||
let guid = GuidBuilder::default()
|
||||
.value(format!("{i}"))
|
||||
.permalink(false)
|
||||
.build();
|
||||
ItemBuilder::default()
|
||||
.title(format!("Blog post {i}"))
|
||||
.description(Some(p.clone()))
|
||||
.guid(guid)
|
||||
.link(format!("https://mdf.farm/#post{i}"))
|
||||
.build()
|
||||
}).collect();
|
||||
print!("{}", channel);
|
||||
},
|
||||
"html" => {
|
||||
print!("{}", posts.iter().map(|p| format!("<div class=\"blogpost\">{p}</div>")).collect::<Vec<String>>().concat())
|
||||
print!("{}", posts.iter().enumerate().map(|(i, p)| format!("<div class=\"blogpost\" id=post{i}>{p}</div>")).collect::<Vec<String>>().concat())
|
||||
},
|
||||
_ => eprintln!("need to specify 'rss' or 'html'"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue