Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colocated images with date from folder #2146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/content/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions components/content/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down