readtime.html 800 B

12345678910111213141516
  1. <!--- "ReadTime on GitHub Jekyll" (c) 2020 Ruby Griffith Ramirez, MIT License -->
  2. {% assign ReadTime = page.content | strip_html | number_of_words %}
  3. {% assign calcReadTime = ReadTime | float %}
  4. {% assign finalReadTime = calcReadTime | divided_by:200 | round: 2 %}
  5. {% assign number = finalReadTime | round %}
  6. {% if number >= 1 %}
  7. {% assign yesReadTime = number | append: " minute read" %}
  8. <span class="reader-time post-meta"><span class="d-none d-md-inline middot">&middot;</span> {{ yesReadTime }}</span>
  9. {% elsif number < 1 %}
  10. {% assign minReadTime = '&lt; 1 minute read' %}
  11. <span class="reader-time post-meta"><span class="d-none d-md-inline middot">&middot;</span> {{ minReadTime }}</span>
  12. {% else %}
  13. {% assign nilReadTime = number | replace:'0',' ' %}
  14. {{ nilReadTime }}
  15. {% endif %}