2021-01-11 11:33:35 +01:00
|
|
|
{% 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 %}
|
|
|
|
|
|
|
|
{% if include.params.excerpt_size %}
|
|
|
|
{% assign excerpt_size = include.params.excerpt_size %}
|
|
|
|
{% else %}
|
|
|
|
{% assign excerpt_size = excerpt_size | default: 800 %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{%- include functions.html func='get_article_words' -%}
|
|
|
|
{% assign words = return %}
|
|
|
|
|
|
|
|
{% assign _article = article | strip_html %}
|
|
|
|
{% assign _words = _article | size %}
|
|
|
|
|
2021-01-11 11:48:37 +01:00
|
|
|
{% assign _size = excerpt_size %}
|
|
|
|
|
2021-01-11 11:33:35 +01:00
|
|
|
{% if lang != "en" %}
|
|
|
|
{% assign _size = words
|
|
|
|
| times: 1.0
|
|
|
|
| divided_by: _words
|
2021-01-11 11:48:37 +01:00
|
|
|
| times: _size
|
2021-01-11 11:33:35 +01:00
|
|
|
| round %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if _size > excerpt_size %}
|
|
|
|
{% assign _size = excerpt_size %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% assign return = _article | truncate: _size %}
|