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
|
@Model.Author?.Name
|
||||||
•
|
•
|
||||||
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")">
|
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")">
|
||||||
@post.Published.Humanize()
|
Published @post.Published.Humanize()
|
||||||
</abbr>
|
</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)
|
@if (post.EnableComments)
|
||||||
{
|
{
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
{
|
{
|
||||||
Author? author = Model.GetAuthor(post);
|
Author? author = Model.GetAuthor(post);
|
||||||
DateTimeOffset published = post.Published;
|
DateTimeOffset published = post.Published;
|
||||||
|
DateTimeOffset timestamp = post.Updated ?? published;
|
||||||
|
bool isUpdated = post.Updated.HasValue;
|
||||||
var year = published.ToString("yyyy");
|
var year = published.ToString("yyyy");
|
||||||
var month = published.ToString("MM");
|
var month = published.ToString("MM");
|
||||||
var day = published.ToString("dd");
|
var day = published.ToString("dd");
|
||||||
@ -33,8 +35,8 @@
|
|||||||
<img class="blog-author-icon" src="https://gravatar.com/avatar/@author?.AvatarHash?s=28">
|
<img class="blog-author-icon" src="https://gravatar.com/avatar/@author?.AvatarHash?s=28">
|
||||||
@author?.Name
|
@author?.Name
|
||||||
•
|
•
|
||||||
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")">
|
<abbr data-bs-toggle="tooltip" data-bs-title="@timestamp.ToString("f")">
|
||||||
@post.Published.Humanize()
|
@(isUpdated ? "Updated" : "Published") @timestamp.Humanize()
|
||||||
</abbr>
|
</abbr>
|
||||||
@if (post.EnableComments)
|
@if (post.EnableComments)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user