parent
8e9b779fc6
commit
e62664b4ff
|
@ -20,6 +20,7 @@
|
||||||
3. `get_file_hash` now returns base64 encoded hash by default
|
3. `get_file_hash` now returns base64 encoded hash by default
|
||||||
4. all functions working on files can now only load files in the Zola directory
|
4. all functions working on files can now only load files in the Zola directory
|
||||||
5. `resize_image` return value has changed
|
5. `resize_image` return value has changed
|
||||||
|
6. `page.assets` now start with a `/` to match `section.assets` and other paths
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
||||||
|
|
|
@ -299,7 +299,7 @@ impl Page {
|
||||||
.to_path_buf();
|
.to_path_buf();
|
||||||
path
|
path
|
||||||
})
|
})
|
||||||
.map(|path| path.to_string_lossy().to_string())
|
.map(|path| format!("/{}", path.display()))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,6 +567,7 @@ And here's another. [^2]
|
||||||
assert_eq!(page.file.parent, path.join("content").join("posts"));
|
assert_eq!(page.file.parent, path.join("content").join("posts"));
|
||||||
assert_eq!(page.slug, "with-assets");
|
assert_eq!(page.slug, "with-assets");
|
||||||
assert_eq!(page.assets.len(), 3);
|
assert_eq!(page.assets.len(), 3);
|
||||||
|
assert!(section.serialized_assets[0].starts_with('/'));
|
||||||
assert_eq!(page.permalink, "http://a-website.com/posts/with-assets/");
|
assert_eq!(page.permalink, "http://a-website.com/posts/with-assets/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ impl Section {
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|asset| asset.file_name())
|
.filter_map(|asset| asset.file_name())
|
||||||
.filter_map(|filename| filename.to_str())
|
.filter_map(|filename| filename.to_str())
|
||||||
.map(|filename| self.path.clone() + filename)
|
.map(|filename| format!("{}{}", self.path, filename))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +258,7 @@ mod tests {
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
let section = res.unwrap();
|
let section = res.unwrap();
|
||||||
assert_eq!(section.assets.len(), 3);
|
assert_eq!(section.assets.len(), 3);
|
||||||
|
assert!(section.serialized_assets[0].starts_with('/'));
|
||||||
assert_eq!(section.permalink, "http://a-website.com/posts/with-assets/");
|
assert_eq!(section.permalink, "http://a-website.com/posts/with-assets/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue