-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.liquid
36 lines (33 loc) · 1.83 KB
/
test.liquid
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
{% assign post_read_time = {include.post_read_time %}
{% assign post_show_date = {include.post_show_date %}
{% assign post_date = {include.post_date %}
{% assign post_words_per_minute = include.post_words_per_minute %}
{% assign post_content = {include.post_content} %}
{% if post_read_time or post_show_date %}
<p class="page__meta">
{% if post_show_date and post_date %}
{% assign date = post_date %}
<span class="page__meta-date">
<i class="far {% if include.type == 'grid' and post_read_time and post_show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
<time datetime="{{ date | date_to_xmlschema }}">{{ date | date: date_format }}</time>
</span>
{% endif %}
{% if post_read_time and post_show_date %}<span class="page__meta-sep">condition is true</span>{% endif %}
{% if post_read_time}
{% assign words_per_minute = post_words_per_minute | default: site.words_per_minute | default: 200 %}
{% assign words = post_content | strip_html | number_of_words %}
{{words}}
<span class="page__meta-readtime">
<i class="far {% if include.type == 'grid' and post_read_time and post_show_date %}fa-fw {% endif %}fa-clock" aria-hidden="true"></i>
{% 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 %}
</span>
{% endif %}
</p>
{% endif %}