Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Rose <est.michael@gmail.com>2015-12-07 16:43:34 +0300
committerMichael Rose <est.michael@gmail.com>2015-12-07 16:44:03 +0300
commitf8a46160a15638d604ab1b138e8872e9c06effc9 (patch)
treeb53c3f7fe1a04625536ee82d682ed21475561c08
parent790781b7f0b2f7c938d5c8429a657ce74405c757 (diff)
Fix read time bug on post-index.html layout
- Was incorrectly calculating read time for the index page and not each post individually
-rw-r--r--_includes/read-time-index.html2
-rw-r--r--index.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/_includes/read-time-index.html b/_includes/read-time-index.html
new file mode 100644
index 0000000..cae3406
--- /dev/null
+++ b/_includes/read-time-index.html
@@ -0,0 +1,2 @@
+{% assign readtime = post.content | strip_html | number_of_words | divided_by:site.words_per_minute %}
+Reading time ~{% if readtime <= 1 %}1 minute{% else %}{{ readtime }} minutes{% endif %} \ No newline at end of file
diff --git a/index.html b/index.html
index 2f367ed..c60f0f9 100644
--- a/index.html
+++ b/index.html
@@ -23,7 +23,7 @@ image:
{% if site.reading_time %}
<span class="entry-reading-time">
<i class="fa fa-clock-o"></i>
- {% include read-time.html %}
+ {% include read-time-index.html %}
</span><!-- /.entry-reading-time -->
{% endif %}
</div><!-- /.entry-meta -->