feat: WordCount
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
<div class="article-meta">
|
||||
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
|
||||
<%- partial('post/category') %>
|
||||
<% if(theme.word_count && theme.word_count.enable && !post.no_word_count){%>
|
||||
<%- partial('post/word') %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
@@ -32,10 +35,10 @@
|
||||
<% } %>
|
||||
<!-- 打赏 -->
|
||||
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %>
|
||||
<div id="reward-btn">
|
||||
打赏
|
||||
</div>
|
||||
<% } %>
|
||||
<div id="reward-btn">
|
||||
打赏
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer class="article-footer">
|
||||
<a data-url="<%- post.permalink %>" data-id="<%= post._id %>"
|
||||
|
22
layout/_partial/post/word.ejs
Normal file
22
layout/_partial/post/word.ejs
Normal file
@@ -0,0 +1,22 @@
|
||||
<% if (!theme.word_count.only_article_visit || (!index && theme.word_count.only_article_visit)){ %>
|
||||
<div style="margin-top:10px;">
|
||||
<span class="post-time">
|
||||
<span class="post-meta-item-icon">
|
||||
<!-- fonts.scss -->
|
||||
<!-- 百度字体平台:http://fontstore.baidu.com/static/editor/index.html -->
|
||||
<i class="icon-statistics"></i>
|
||||
<span class="post-meta-item-text"> 字数统计:</span>
|
||||
<span class="post-count"><%= wordcount(post.content) %>字</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span class="post-time">
|
||||
|
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="icon-book icon"></i>
|
||||
<span class="post-meta-item-text"> 阅读时长≈</span>
|
||||
<span class="post-count"><%= min2read(post.content) %>分</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<% } %>
|
Reference in New Issue
Block a user