diff --git a/_includes/read_time.html b/_includes/read_time.html new file mode 100644 index 0000000000..9a7565e233 --- /dev/null +++ b/_includes/read_time.html @@ -0,0 +1,9 @@ + + Estimated reading time: + {% assign words = content | number_of_words %} + {% if words < 360 %} + 1 minute + {% else %} + {{ words | divided_by:180 }} minutes + {% endif %} + diff --git a/_layouts/docs.html b/_layouts/docs.html index 408ddbea2c..14f764caeb 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -206,6 +206,7 @@ ng\:form { {% if page.title %}{{ page.title }}{% endif %} {% if page.advisory %}{{ site.data.advisories.texts[page.advisory] }}{% endif %} + {% include read_time.html %} {{ content }} {% if page.noratings != true %} diff --git a/css/documentation.css b/css/documentation.css index 304b9d18ce..45bca67bf5 100644 --- a/css/documentation.css +++ b/css/documentation.css @@ -346,3 +346,17 @@ color: #F04124; } /* end search */ + +/* begin reading_time */ + +span.reading-time { + font-style: italic; + font-size: 80%; + display: block; + padding-top: 10px; + padding-bottom: 10px; + color: #999; +} + +span.reading-time-label { +}
{{ site.data.advisories.texts[page.advisory] }}