-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost_meta.html
More file actions
38 lines (38 loc) · 1.85 KB
/
post_meta.html
File metadata and controls
38 lines (38 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% assign document = post | default: page %}
{% if document.read_time or document.show_date %}
<span class = "{{ include.type }}">
{% if include.type == "post-page-meta" %}
<p class="page_meta">
{% endif %}
{% if include.type == "post-card-meta" %}
<span class="meta-pre"></span>
{% endif %}
{% unless include.date == "none" %}
{% if document.show_date and document.date %}
{% assign date = document.date %}
<{% if include.type == "recent-item-meta" %}p{% else %}span{% endif %} class="page_meta-date">
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
</{% if include.type == "recent-item-meta" %}p{% else %}span{% endif %}>
{% endif %}
{% unless include.type == "recent-item-meta" %}
{% if document.read_time and document.show_date %}<span class="meta-sep"></span>{% endif %}
{% endunless %}
{% endunless %}
{% if document.read_time %}
{% assign words_per_minute = document.words_per_minute | default: site.words_per_minute | default: 200 %}
{% assign words = document.content | strip_html | number_of_words %}
<{% if include.type == "recent-item-meta" %}p{% else %}span{% endif %} class="page_meta-readtime">
{% if words < words_per_minute %}
{{ site.data.ui-text[site.locale].less_than | default: 'less than' }} 1 {{ site.data.ui-text[site.locale].minute_read | default: 'minute read' }}
{% elsif words == words_per_minute %}
1 {{ site.data.ui-text[site.locale].minute_read | default: 'minute read' }}
{% else %}
{{ words | divided_by: words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: 'minute read' }}
{% endif %}
</{% if include.type == "recent-item-meta" %}p{% else %}span{% endif %}>
{% endif %}
{% if include.type == "post-page-meta" %}
</p>
{% endif %}
</span>
{% endif %}