hexo-theme-keep/layout/_partial/article-meta-info.ejs

71 lines
3.0 KiB
Plaintext
Raw Normal View History

<%
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>&nbsp;
<% } else { %>
<i class="fas fa-edit"></i>&nbsp;
<% } %>
2021-11-22 21:25:07 +08:00
<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>&nbsp;
<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">
2021-01-21 20:05:30 +08:00
<i class="fas fa-folder"></i>&nbsp;
<ul>
<% articleObject.categories.forEach((category, i) => { %>
<li>
2021-01-21 20:05:30 +08:00
<%= i === 0 ? '' : '> ' %><a href="<%- url_for(category.path) %>"><%= category.name %></a>&nbsp;
</li>
<% }); %>
</ul>
</span>
<% } %>
<% if (articleObject.tags.length) { %>
<span class="article-tags article-meta-item">
2021-01-21 20:05:30 +08:00
<i class="fas fa-tags"></i>&nbsp;
<ul>
<% articleObject.tags.forEach((tag, i) => { %>
<li>
2021-01-21 20:05:30 +08:00
<%= i === 0 ? '' : '| ' %><a href="<%- url_for(tag.path) %>"><%= tag.name %></a>&nbsp;
</li>
<% }); %>
</ul>
</span>
<% } %>
<%
let temp_wordcount_count, temp_min2read_count = null
try {
temp_wordcount_count = wordcount(page.content)
temp_min2read_count = min2read(page.content)
} catch (e) {
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){ %>
<span class="article-wordcount article-meta-item">
2021-01-21 20:05:30 +08:00
<i class="fas fa-file-word"></i>&nbsp;<span><%= temp_wordcount_count %> <%- __('wordcount') %></span>
2020-08-13 10:14:33 +08:00
</span>
<% } %>
<% if(is_post() && theme.hasOwnProperty('post') && theme.post.word_count.enable && theme.post.word_count.min2read && temp_min2read_count){ %>
<span class="article-min2read article-meta-item">
2021-01-21 20:05:30 +08:00
<i class="fas fa-clock"></i>&nbsp;<span><%= temp_min2read_count %> <%- __('min2read') %></span>
2020-10-27 18:11:10 +08:00
</span>
<% } %>
<% if (is_post() && theme.website_count.busuanzi_count.enable && theme.website_count.busuanzi_count.page_pv) { %>
<span class="article-pv article-meta-item">
2021-01-21 20:05:30 +08:00
<i class="fas fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
2020-08-13 10:14:33 +08:00
</span>
<% } %>
</div>