mirror of
https://github.com/zyllian/webdog.git
synced 2025-01-18 11:44:35 -08:00
Make image timestamps a bit more readable
This commit is contained in:
parent
24084d7e67
commit
80be46962d
1 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,7 @@ impl ImageMetadata {
|
||||||
image: &self,
|
image: &self,
|
||||||
src: self.cdn_url(&builder.site.config)?.to_string(),
|
src: self.cdn_url(&builder.site.config)?.to_string(),
|
||||||
id: &id,
|
id: &id,
|
||||||
|
timestamp: self.timestamp,
|
||||||
};
|
};
|
||||||
builder.reg.render("image", &data)?
|
builder.reg.render("image", &data)?
|
||||||
};
|
};
|
||||||
|
@ -110,6 +111,7 @@ impl ImageMetadata {
|
||||||
image: metadata,
|
image: metadata,
|
||||||
src: metadata.cdn_url(&builder.site.config)?.to_string(),
|
src: metadata.cdn_url(&builder.site.config)?.to_string(),
|
||||||
id,
|
id,
|
||||||
|
timestamp: metadata.timestamp,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,6 +274,9 @@ struct ImageTemplateData<'i> {
|
||||||
src: String,
|
src: String,
|
||||||
/// The image's ID.
|
/// The image's ID.
|
||||||
id: &'i str,
|
id: &'i str,
|
||||||
|
/// The image's timestamp. (Duplicated to change the serialization method.)
|
||||||
|
#[serde(serialize_with = "time::serde::rfc2822::serialize")]
|
||||||
|
timestamp: OffsetDateTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Template data for image lists.
|
/// Template data for image lists.
|
||||||
|
|
Loading…
Add table
Reference in a new issue