@@ 94,7 94,11 @@ pub async fn list_posts(path: &Path, args: &Args) -> Vec<Post> {
pub async fn read_title(path: &Path) -> Option<String> {
let extension = path.extension();
if extension == Some(OsStr::new("html")) || extension == Some(OsStr::new("htm")) {
- return read_html_title(path).await;
+ let title = read_html_title(path).await;
+ return match title {
+ Some(x) if x.len() == 0 => None,
+ _ => title,
+ };
}
let file = tokio::fs::File::open(path).await.ok()?;
let reader = tokio::io::BufReader::new(file);