Permalink
Browse files

Add estimated reading time to post metadata

- Set `reading_time = false` under `[params]` config to disable
  • Loading branch information...
gcushen committed Sep 30, 2017
1 parent 34b9cf5 commit 6270d6e4a034d01f2481f2693ccb24dd676f2375
Showing with 13 additions and 0 deletions.
  1. +3 −0 exampleSite/config.toml
  2. +3 −0 i18n/en.yaml
  3. +6 −0 layouts/partials/article_metadata.html
  4. +1 −0 layouts/partials/css/academic.css
View
@@ -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
View
@@ -11,6 +11,9 @@
- id: related
translation: Related
- id: minute_read
translation: min read
# Buttons
- id: btn_details
@@ -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 }}
@@ -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;

0 comments on commit 6270d6e

Please sign in to comment.