feat(post): displays the post update time (#145)
This commit is contained in:
parent
e931ea8f4f
commit
4d89ea984f
|
@ -1,9 +1,22 @@
|
|||
<%
|
||||
const ami_is_updated = articleObject.date !== articleObject.updated
|
||||
%>
|
||||
<div class="article-meta-info">
|
||||
<span class="article-date article-meta-item">
|
||||
<% if(ami_is_updated) { %>
|
||||
<i class="fa-regular fa-calendar-plus"></i>
|
||||
<% } else { %>
|
||||
<i class="fas fa-edit"></i>
|
||||
<% } %>
|
||||
<span class="pc"><%= date(articleObject.date, is_post() ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD') %></span>
|
||||
<span class="mobile"><%= date(articleObject.date, is_post() ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD') %></span>
|
||||
</span>
|
||||
<% if (ami_is_updated) { %>
|
||||
<span class="article-update-date article-meta-item">
|
||||
<i class="fas fa-file-pen"></i>
|
||||
<span class="pc"><%= date(articleObject.updated, 'YYYY-MM-DD HH:mm:ss') %></span>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (articleObject.categories.length) { %>
|
||||
<span class="article-categories article-meta-item">
|
||||
<i class="fas fa-folder"></i>
|
||||
|
@ -30,13 +43,13 @@
|
|||
<% } %>
|
||||
|
||||
<%
|
||||
let temp_wordcount_count, temp_min2read_count = null;
|
||||
let temp_wordcount_count, temp_min2read_count = null
|
||||
try {
|
||||
temp_wordcount_count = wordcount(page.content);
|
||||
temp_min2read_count = min2read(page.content);
|
||||
temp_wordcount_count = wordcount(page.content)
|
||||
temp_min2read_count = min2read(page.content)
|
||||
} catch (e) {
|
||||
temp_wordcount_count = 0;
|
||||
temp_min2read_count = 0;
|
||||
temp_wordcount_count = 0
|
||||
temp_min2read_count = 0
|
||||
}
|
||||
%>
|
||||
<% if(is_post() && theme.hasOwnProperty('post') && theme.post.word_count.enable && theme.post.word_count.wordcount && temp_wordcount_count){ %>
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
<%
|
||||
const target_date = post.date !== post.updated ? post.updated : post.date
|
||||
%>
|
||||
<div class="home-article-meta-info-container">
|
||||
<div class="home-article-meta-info">
|
||||
<span><i class="fas fa-history"></i> <span class="home-article-date" data-date="<%= post.date %>"><%= date(post.date, 'YYYY-MM-DD') %></span></span>
|
||||
<span>
|
||||
<i class="fas fa-history"></i>
|
||||
<span class="home-article-date" data-date="<%= target_date %>">
|
||||
<%= date(target_date, 'YYYY-MM-DD') %>
|
||||
</span>
|
||||
</span>
|
||||
<% if (post.categories.length && theme.home_article.category.enable === true) { %>
|
||||
<span class="home-article-category"><i class="fas fa-folder"></i>
|
||||
<ul>
|
||||
|
|
|
@ -28,6 +28,12 @@
|
|||
}
|
||||
|
||||
|
||||
.article-update-date {
|
||||
+keep-tablet() {
|
||||
display none
|
||||
}
|
||||
}
|
||||
|
||||
.article-tags
|
||||
.article-categories {
|
||||
display inline
|
||||
|
|
Loading…
Reference in New Issue