Add estimated reading time to post metadata

- Set `reading_time = false` under `[params]` config to disable
This commit is contained in:
George Cushen committed 2017-09-30 19:55:38 +01:00
1 parent 34b9cf573c
commit 6270d6e4a0
4 files changed
+13

No files matched your search

+3
View File
@@ -53,6 +53,9 @@ defaultContentLanguageInSubdir = false
# Examples: "Mon, Jan 2, 2006" or "2006-01-02"
date_format = "Jan 2, 2006"
# Show estimated reading time for posts?
reading_time = true
# Enable global LaTeX math rendering?
# If false, you can enable it locally on a per page basis.
math = false
+3
View File
@@ -11,6 +11,9 @@
- id: related
translation: Related
- id: minute_read
translation: min read
# Buttons
- id: btn_details
+6
View File
@@ -11,6 +11,12 @@
</time>
</span>
{{ if ne $.Site.Params.reading_time false }}
<span class="article-reading-time">
{{ $.ReadingTime }} {{ i18n "minute_read" }}
</span>
{{ end }}
{{ if isset $.Params "categories" }}
{{ $categoriesLen := len $.Params.categories }}
{{ if gt $categoriesLen 0 }}
+1
View File
@@ -465,6 +465,7 @@ article {
}
.article-metadata .article-date,
.article-metadata .article-reading-time,
.article-metadata .article-categories,
.article-metadata .article-tags {
margin-right: 10px;