Fix for division by 0 error caused by null words_per_minute
This commit is contained in:
parent
3ed08304ea
commit
083ab747e1
@ -27,10 +27,44 @@ en: &DEFAULT_EN
|
|||||||
website_label : "Website"
|
website_label : "Website"
|
||||||
email_label : "Email"
|
email_label : "Email"
|
||||||
recent_posts : "Recent Posts"
|
recent_posts : "Recent Posts"
|
||||||
|
undefined_wpm : "Undefined parameter words_per_minute at _config.yml"
|
||||||
en-US:
|
en-US:
|
||||||
<<: *DEFAULT_EN
|
<<: *DEFAULT_EN
|
||||||
en-UK:
|
en-UK:
|
||||||
<<: *DEFAULT_EN
|
<<: *DEFAULT_EN
|
||||||
|
|
||||||
|
# Spanish
|
||||||
|
# --------------
|
||||||
|
es: &DEFAULT_ES
|
||||||
|
page : "Página"
|
||||||
|
pagination_previous : "Anterior"
|
||||||
|
pagination_next : "Siguiente"
|
||||||
|
breadcrumb_home_label : "Inicio"
|
||||||
|
breadcrumb_separator : "/"
|
||||||
|
toc_label : "Contenidos"
|
||||||
|
ext_link_label : "Enlace"
|
||||||
|
less_than : "menos de"
|
||||||
|
minute_read : "minuto de lectura"
|
||||||
|
minutes_read : "minutos de lectura"
|
||||||
|
share_on_label : "Compartir"
|
||||||
|
meta_label :
|
||||||
|
tags_label : "Etiquetas:"
|
||||||
|
categories_label : "Categorías:"
|
||||||
|
date_label : "Actualizado:"
|
||||||
|
comments_label : "Comentar"
|
||||||
|
more_label : "Ver más"
|
||||||
|
related_label : "Podrías ver también"
|
||||||
|
follow_label : "Seguir:"
|
||||||
|
feed_label : "Feed"
|
||||||
|
powered_by : "Powered by"
|
||||||
|
website_label : "Sitio web"
|
||||||
|
email_label : "Email"
|
||||||
|
recent_posts : "Entradas recientes"
|
||||||
|
undefined_wpm : "Parametro words_per_minute (Palabras por minuto) no definido en _config.yml"
|
||||||
|
es-ES:
|
||||||
|
<<: *DEFAULT_ES
|
||||||
|
es-CO:
|
||||||
|
<<: *DEFAULT_ES
|
||||||
|
|
||||||
# Another locale
|
# Another locale
|
||||||
# --------------
|
# --------------
|
@ -4,10 +4,14 @@
|
|||||||
{% assign words = page.content | strip_html | number_of_words %}
|
{% assign words = page.content | strip_html | number_of_words %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if words < 180 %}
|
{% if site.words_per_minute %}
|
||||||
{{ site.data.ui-text[site.locale].less_than }} 1 {{ site.data.ui-text[site.locale].minute_read }}
|
{% if words < 180 %}
|
||||||
{% elsif words < 360 %}
|
{{ site.data.ui-text[site.locale].less_than }} 1 {{ site.data.ui-text[site.locale].minute_read }}
|
||||||
1 {{ site.data.ui-text[site.locale].minute_read }}
|
{% elsif words < 360 %}
|
||||||
|
1 {{ site.data.ui-text[site.locale].minute_read }}
|
||||||
|
{% else %}
|
||||||
|
{{ words | divided_by:site.words_per_minute }} {{ site.data.ui-text[site.locale].minutes_read }}
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ words | divided_by:site.words_per_minute }} {{ site.data.ui-text[site.locale].minutes_read }}
|
{{ site.data.ui-text[site.locale].undefined_words_per_minute }}
|
||||||
{% endif %}
|
{% endif %}
|
Loading…
Reference in New Issue
Block a user