aboutsummaryrefslogtreecommitdiff
path: root/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'code/src')
-rw-r--r--code/src/atom.rs3
-rw-r--r--code/src/main.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/code/src/atom.rs b/code/src/atom.rs
index 4c6a771..ce6aa6e 100644
--- a/code/src/atom.rs
+++ b/code/src/atom.rs
@@ -1,4 +1,4 @@
-use crate::{get_articles, Args, ArticleMeta, BLOG_BASE};
+use crate::{get_articles, markdown::escape, Args, ArticleMeta, BLOG_BASE};
use std::process::{Command, Stdio};
pub fn generate_atom(args: &Args) -> String {
@@ -11,6 +11,7 @@ pub fn generate_atom(args: &Args) -> String {
filename,
..
}| {
+ let title = escape(title);
let datetime = iso8601::DateTime {
date: date.clone(),
time: iso8601::Time {
diff --git a/code/src/main.rs b/code/src/main.rs
index ed0a62a..693c120 100644
--- a/code/src/main.rs
+++ b/code/src/main.rs
@@ -84,7 +84,7 @@ fn article_metadata(path: PathBuf) -> ArticleMeta {
let mut buf = String::new();
f.read_line(&mut buf).unwrap(); // assume the 1st line has the title
ArticleMeta {
- title: String::from(&buf[2..]),
+ title: String::from(buf[2..].trim()),
filename: path.file_name().unwrap().to_str().unwrap().to_string(),
date: iso8601::date(&path.file_name().unwrap().to_str().unwrap()[0..10]).unwrap(),
path,