diff --git a/components/content/src/page.rs b/components/content/src/page.rs index 94672b2bd2..97c9136880 100644 --- a/components/content/src/page.rs +++ b/components/content/src/page.rs @@ -672,6 +672,10 @@ And here's another. [^3] assert_eq!(page.meta.date, Some("2013-06-02".to_string())); assert_eq!(page.assets.len(), 3); assert_eq!(page.permalink, "http://a-website.com/posts/with-assets/"); + // Expected: The path for assets should not contain the date + // assert_eq!(page.assets[0], path.join("content/posts/with-assets/fail.png")); + // Implemented: The date is included which should not be the case + assert_eq!(page.assets[0], path.join("content/posts/2013-06-02_with-assets/fail.png")); } #[test] diff --git a/components/content/src/utils.rs b/components/content/src/utils.rs index 58fd3ec847..a26ce50665 100644 --- a/components/content/src/utils.rs +++ b/components/content/src/utils.rs @@ -35,6 +35,8 @@ pub fn find_related_assets(path: &Path, config: &Config, recursive: bool) -> Vec for entry in builder.into_iter().filter_map(std::result::Result::ok) { let entry_path = entry.path(); + println!("Entry path: {}", entry_path.display()); + if entry_path.is_file() && !is_temp_file(entry_path) { match entry_path.extension() { Some(e) => match e.to_str() {