page__meta.html 1.6 KB

123456789101112131415161718192021222324252627282930
  1. {% assign document = post | default: page %}
  2. {% if document.read_time or document.show_date %}
  3. <p class="page__meta">
  4. {% if document.show_date and document.date %}
  5. {% assign date = document.date %}
  6. <span class="page__meta-date">
  7. <i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-calendar-alt" aria-hidden="true"></i>
  8. <time datetime="{{ date | date_to_xmlschema }}">{{ date | date: "%B %-d, %Y" }}</time>
  9. </span>
  10. {% endif %}
  11. {% if document.read_time and document.show_date %}<span class="page__meta-sep"></span>{% endif %}
  12. {% if document.read_time %}
  13. {% assign words_per_minute = document.words_per_minute | default: site.words_per_minute | default: 200 %}
  14. {% assign words = document.content | strip_html | number_of_words %}
  15. <span class="page__meta-readtime">
  16. <i class="far {% if include.type == 'grid' and document.read_time and document.show_date %}fa-fw {% endif %}fa-clock" aria-hidden="true"></i>
  17. {% if words < words_per_minute %}
  18. {{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
  19. {% elsif words == words_per_minute %}
  20. 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
  21. {% else %}
  22. {{ words | divided_by: words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
  23. {% endif %}
  24. </span>
  25. {% endif %}
  26. </p>
  27. {% endif %}