mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Set default values for site variables
good for gem-based first run
This commit is contained in:
@@ -3,13 +3,17 @@
|
||||
-->
|
||||
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
||||
|
||||
{% assign read_time = words | divided_by: site.data.read_time.wpm %}
|
||||
<!-- words per minute -->
|
||||
{% assign wpm = 180 %}
|
||||
{% assign min_time = 1 %}
|
||||
|
||||
{% assign read_time = words | divided_by: wpm %}
|
||||
|
||||
{% unless read_time > 0 %}
|
||||
{% assign read_time = site.data.read_time.min_time %}
|
||||
{% assign read_time = min_time %}
|
||||
{% endunless %}
|
||||
|
||||
<!-- return element -->
|
||||
<span class="readtime" data-toggle="tooltip" data-placement="bottom" title="{{ words }} words">
|
||||
{{- read_time -}}{{" "}}{{- site.data.read_time.prompt -}}
|
||||
{{- read_time -}}{{" "}}{{- site.data.label.read_time_unit | default: "min" -}}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user