diff --git a/src/utils.rs b/src/utils.rs index 13ba6ac..31c58aa 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -27,6 +27,17 @@ pub struct FileEntry { pub tags: Vec, } +impl FileEntry { + pub fn filename(&self) -> &str { + Path::new(&self.path) + .file_name() + .to_owned() + .unwrap() + .to_str() + .unwrap() + } +} + fn load_tag_file(path: &PathBuf) -> Result> { let mut file = File::open(path)?; let mut contents = String::new(); diff --git a/templates/list.html b/templates/list.html index 1378269..345f292 100644 --- a/templates/list.html +++ b/templates/list.html @@ -4,6 +4,7 @@