diff options
author | Luís Fernando Guedes <lfernandoguedes@gmail.com> | 2019-01-19 10:26:25 +0300 |
---|---|---|
committer | Juraj Bubniak <juraj.bubniak@gmail.com> | 2019-01-19 10:26:25 +0300 |
commit | 485b8aabe7a975fe3c1d10dfa3bba1f07f7c609e (patch) | |
tree | 8df9fe94dcf658df1bcf2a5c991f8c512f998456 | |
parent | 369507039ce5140542b5cba8c1e0f4a3ea270b11 (diff) |
Add reading time to post page (#63)
* Add reading time feature
* Add params to config example
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/post-header.html | 5 |
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 |