aboutsummaryrefslogtreecommitdiff
path: root/code/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'code/src/main.rs')
-rw-r--r--code/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/code/src/main.rs b/code/src/main.rs
index 693c120..83bcefe 100644
--- a/code/src/main.rs
+++ b/code/src/main.rs
@@ -74,7 +74,7 @@ pub fn get_articles(root: &str) -> Vec<ArticleMeta> {
pub struct ArticleMeta {
title: String,
- filename: String,
+ canonical_name: String,
date: iso8601::Date,
path: PathBuf,
}
@@ -85,7 +85,7 @@ fn article_metadata(path: PathBuf) -> ArticleMeta {
f.read_line(&mut buf).unwrap(); // assume the 1st line has the title
ArticleMeta {
title: String::from(buf[2..].trim()),
- filename: path.file_name().unwrap().to_str().unwrap().to_string(),
+ canonical_name: path.file_stem().unwrap().to_str().unwrap().to_string(),
date: iso8601::date(&path.file_name().unwrap().to_str().unwrap()[0..10]).unwrap(),
path,
}