Skip to content

Commit

Permalink
perf: optimize the display of post update time (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Oct 12, 2024
1 parent 19be89b commit c57764d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions layout/_partial/post/post-meta-info.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { created_datetime_icon, updated_datetime_icon } = theme?.post || {}
<div class="post-meta-info-container border-box <%= page_type %>">
<div class="post-meta-info border-box">
<% if (page_type === 'home' && show_home_post_block_datetime) { %>
<% if (page_type === 'home' && show_home_post_block_datetime && home_post_block_datetime) { %>
<span class="meta-info-item border-box">
<i class="icon <%= home_post_block_datetime_icon %>"></i>&nbsp;<span class="home-post-history"
data-updated="<%= home_post_block_datetime %>"
Expand All @@ -35,10 +35,12 @@ const { created_datetime_icon, updated_datetime_icon } = theme?.post || {}
<span class="datetime"><%= date(post.date, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<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.updated) { %>
<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 c57764d

Please sign in to comment.