1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Feature: Add reading time to posts

This commit is contained in:
Cotes Chung
2020-12-17 15:17:21 +08:00
parent 87ba30a393
commit b9ffe15ffb
6 changed files with 66 additions and 24 deletions

View File

@@ -18,33 +18,31 @@ layout: default
<div class="post-meta text-muted d-flex flex-column">
<!-- Published date and author -->
<div>
Posted
{% include timeago.html date=page.date tooltip=true %}
by
<span class="author">
{% if page.author %}
{{ page.author }}
{% else %}
{{ site.author }}
{% endif %}
{{ page.author | default: site.author }}
</span>
</div>
<!-- lastmod -->
{% if page.last_modified_at %}
<div>
Updated
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
</div>
{% endif %}
<!-- lastmod -->
{% if page.last_modified_at %}
<span>
Updated
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
</span>
{% endif %}
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<div>
<!-- read time -->
{% include read-time.html content=content %}
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
views
{% endif %}
</div>
{% endif %}
</div> <!-- .post-meta -->