Skip to content

Commit 614b8ea

Browse files
authored
ADD: hexo-wordcount plugin support. (5)
1 parent 4965910 commit 614b8ea

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

layout/_macro/post.swig

+32
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,38 @@
193193
</span>
194194
{% endif %}
195195

196+
{% if theme.post_wordcount.wordcount or theme.post_wordcount.min2read %}
197+
<div class="post-wordcount">
198+
{% if theme.post_wordcount.wordcount %}
199+
<span class="post-meta-item-icon">
200+
<i class="fa fa-file-word-o"></i>
201+
</span>
202+
{% if theme.post_wordcount.item_text %}
203+
<span class="post-meta-item-text">{{ __('post.wordcount') }}</span>
204+
{% endif %}
205+
<span title="{{ __('post.wordcount') }}" }}">
206+
{{ wordcount(post.content) }}
207+
</span>
208+
{% endif %}
209+
210+
{% if theme.post_wordcount.wordcount and theme.post_wordcount.min2read %}
211+
<span class="post-meta-divider">|</span>
212+
{% endif %}
213+
214+
{% if theme.post_wordcount.min2read %}
215+
<span class="post-meta-item-icon">
216+
<i class="fa fa-clock-o"></i>
217+
</span>
218+
{% if theme.post_wordcount.item_text %}
219+
<span class="post-meta-item-text">{{ __('post.min2read') }}</span>
220+
{% endif %}
221+
<span title="{{ __('post.min2read') }}" }}">
222+
{{ min2read(post.content) }}
223+
</span>
224+
{% endif %}
225+
</div>
226+
{% endif %}
227+
196228
{% if post.description and (not theme.excerpt_description or not is_index) %}
197229
<div class="post-description">
198230
{{ post.description }}

0 commit comments

Comments
 (0)