Sha256: 4b109cbbf586d843ed631a1e7ff05fc53ee4d7d849e63f92df7f4203f95a004b

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

{% 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.speed %}
    {% assign speed = include.params.speed %}
{% else %}
    {% assign speed = 160 %}
{% endif %}

{%- include functions.html func='get_article_words' -%}
{% assign words = return %}

{% assign total_mins = words | divided_by: speed | at_least: 1 %}

{% assign hours = total_mins | divided_by: 60 %}
{% assign mins = total_mins | modulo: 60 %}

{% assign return = "About" %}

{% if hours > 0 %}
    {% assign unit = "hour" %}
    {% if hours > 1 %}
        {% assign unit = unit | append: "s" %}
    {% endif %}
    {% assign return = return | append: " " | append: hours | append: " " | append: unit %}
{% endif %}

{% assign unit = "min" %}
{% if mins > 1 %}
    {% assign unit = unit | append: "s" %}
{% endif %}
{% assign return = return | append: " " | append: mins | append: " " | append: unit %}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
redeyed-jekyll-theme-0.1.7 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.6 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.5 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.4 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.3 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.2 _includes/functions/get-reading-time.html
redeyed-jekyll-theme-0.1.1 _includes/functions/get-reading-time.html