Skip to content

Commit

Permalink
fix: hide post-updated when it same as create time or update time is …
Browse files Browse the repository at this point in the history
…null
  • Loading branch information
lyujp committed Oct 11, 2024
1 parent 240364b commit 719ad92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layout/_partial/post/post-meta-info.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const { created_datetime_icon, updated_datetime_icon } = theme?.post || {}
<i class="icon <%= created_datetime_icon || 'fa-solid fa-calendar-plus' %>"></i>&nbsp;
<span class="datetime"><%= date(post.date, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<% if(date(post.date, 'YYYY-MM-DD HH:mm:ss') !== date(post.updated, 'YYYY-MM-DD HH:mm:ss') && post.updated != null) { %>
<span class="meta-info-item post-update-date">
<i class="icon <%= updated_datetime_icon || 'fa-solid fa-file-pen' %>"></i>&nbsp;
<span class="datetime" data-updated="<%= post.updated %>"><%= date(post.updated, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<% } %>
<% } %>
<% if (post.categories.length && (theme?.home?.category === true || page_type === 'post')) { %>
Expand Down

0 comments on commit 719ad92

Please sign in to comment.