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

github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuís Fernando Guedes <lfernandoguedes@gmail.com>2019-01-19 10:26:25 +0300
committerJuraj Bubniak <juraj.bubniak@gmail.com>2019-01-19 10:26:25 +0300
commit485b8aabe7a975fe3c1d10dfa3bba1f07f7c609e (patch)
tree8df9fe94dcf658df1bcf2a5c991f8c512f998456
parent369507039ce5140542b5cba8c1e0f4a3ea270b11 (diff)
Add reading time to post page (#63)
* Add reading time feature * Add params to config example
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/partials/post-header.html5
2 files changed, 7 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index ad8b53f..0d04149 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -46,6 +46,8 @@ googleAnalytics = "XXX"
exponeaTarget = ""
exponeaToken = ""
exponeaTrackVisits = false
+ readingTime = true
+ readingTimeText = "Estimated reading time:"
[Permalinks]
post = "/:year/:month/:day/:filename/"
diff --git a/layouts/partials/post-header.html b/layouts/partials/post-header.html
index 9e43090..7125340 100644
--- a/layouts/partials/post-header.html
+++ b/layouts/partials/post-header.html
@@ -11,5 +11,10 @@
<a href="{{ .Params.profile | default .Site.Author.profile | default "#" }}" itemprop="url" rel="author">{{ .Params.author | default .Site.Author.name }}</a>
</span>
</span>
+ {{ if .Site.Params.readingTime }}
+ <br />
+ <br />
+ <span>{{ .Site.Params.readingTimeText }} {{ .Page.ReadingTime }} min</span>
+ {{ end }}
</p>
</header> \ No newline at end of file