works
This commit is contained in:
@@ -55,8 +55,15 @@ fn get_posts_directory() -> PathBuf {
|
||||
|
||||
fn get_file_creation_date(path: &Path) -> std::io::Result<DateTime<Utc>> {
|
||||
let metadata = fs::metadata(path)?;
|
||||
let created = metadata.created()?;
|
||||
Ok(DateTime::<Utc>::from(created))
|
||||
// Try to get creation time, fall back to modification time if not available
|
||||
match metadata.created() {
|
||||
Ok(created) => Ok(DateTime::<Utc>::from(created)),
|
||||
Err(_) => {
|
||||
// Fall back to modification time if creation time is not available
|
||||
let modified = metadata.modified()?;
|
||||
Ok(DateTime::<Utc>::from(modified))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn process_anchor_links(content: &str) -> String {
|
||||
|
||||
Reference in New Issue
Block a user