feat: display Update timestamp if post has been updated
This commit is contained in:
parent
84814da85b
commit
6d40452fb3
|
@ -29,8 +29,15 @@
|
|||
@Model.Author?.Name
|
||||
•
|
||||
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")">
|
||||
@post.Published.Humanize()
|
||||
Published @post.Published.Humanize()
|
||||
</abbr>
|
||||
@if (post.Updated is { } updated)
|
||||
{
|
||||
<span>•</span>
|
||||
<abbr data-bs-toggle="tooltip" data-bs-title="@updated.ToString("f")">
|
||||
Updated @updated.Humanize()
|
||||
</abbr>
|
||||
}
|
||||
@if (post.EnableComments)
|
||||
{
|
||||
<span>•</span>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
{
|
||||
Author? author = Model.GetAuthor(post);
|
||||
DateTimeOffset published = post.Published;
|
||||
DateTimeOffset timestamp = post.Updated ?? published;
|
||||
bool isUpdated = post.Updated.HasValue;
|
||||
var year = published.ToString("yyyy");
|
||||
var month = published.ToString("MM");
|
||||
var day = published.ToString("dd");
|
||||
|
@ -33,8 +35,8 @@
|
|||
<img class="blog-author-icon" src="https://gravatar.com/avatar/@author?.AvatarHash?s=28">
|
||||
@author?.Name
|
||||
•
|
||||
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")">
|
||||
@post.Published.Humanize()
|
||||
<abbr data-bs-toggle="tooltip" data-bs-title="@timestamp.ToString("f")">
|
||||
@(isUpdated ? "Updated" : "Published") @timestamp.Humanize()
|
||||
</abbr>
|
||||
@if (post.EnableComments)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue