summaryrefslogtreecommitdiff
path: root/_includes/functions/get_article_words.html
blob: 69db9c6c39fe380d2882e059b439d718deaebb9e (plain)
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
{% if include.params.article %}
  {% assign article = include.params.article %}
{% endif %}

{% if include.params.lang %}
  {% assign lang = include.params.lang %}
{% else %}
  {% assign lang = lang | default: site.lang | default: "en" %}
{% endif %}

{% assign words = article | number_of_words %}

{% if lang != "en" %}
  {% assign words = words
    | times: 0.6
    | round %}
  {% assign words = article
    | strip_html
    | strip_newlines
    | size
    | times: 0.4
    | plus: words
    | round %}
{% endif %}

{% assign return = words %}