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

Redesign the post meta layout

- posted date
- updated date
- read time
- license statement of post bottom
- also refactor the `timeago.js`
This commit is contained in:
Cotes Chung
2021-12-04 06:56:33 +08:00
parent 6220d09ffb
commit 563e8085e8
14 changed files with 113 additions and 112 deletions

View File

@@ -12,37 +12,45 @@ tail_includes:
<h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-meta text-muted d-flex flex-column">
<!-- Published date and author -->
<div class="post-meta text-muted">
<!-- author -->
<div>
<span class="semi-bold">
{{ page.author | default: site.social.name }}
</span>
{% capture _preposition %}{{ site.data.locales[lang].post.published }}{% endcapture %}
{% include timeago.html date=page.date tooltip=true preposition=_preposition %}
{{ site.data.locales[lang].post.written_by }}
<em>{{ page.author | default: site.social.name }}</em>
</div>
<div>
<!-- lastmod -->
{% if page.last_modified_at %}
<div class="d-flex">
<div>
<!-- published date -->
<span>
{{ site.data.locales[lang].post.posted }}
{% include timeago.html date=page.date tooltip=true %}
</span>
<!-- lastmod date -->
{% if page.last_modified_at %}
<span>
{{ site.data.locales[lang].post.updated }}
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
{% include timeago.html date=page.last_modified_at tooltip=true %}
</span>
{% endif %}
{% endif %}
<!-- read time -->
{% include read-time.html content=content prompt=true %}
<!-- read time -->
{% include read-time.html content=content prompt=true %}
<!-- page views -->
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<span id="pv" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
<!-- page views -->
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<span>
<em id="pv" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</em>
{{ site.data.locales[lang].post.pageview_measure }}
</span>
{{ site.data.locales[lang].post.pageview_measure }}
{% endif %}
{% endif %}
</div>
</div>
</div> <!-- .d-flex -->
</div> <!-- .post-meta -->