add reading time param
This commit is contained in:
parent
bbaf93ff6f
commit
0c08f72167
@ -189,7 +189,7 @@ to `config.toml` file in your Hugo root directory and change params fields. In c
|
||||
|
||||
## Post archetype
|
||||
|
||||
See the basic `post` file params supported by the theme — https://github.com/panr/hugo-theme-terminal/blob/master/archetypes/posts.md
|
||||
See the default `post` file params supported by the theme — https://github.com/panr/hugo-theme-terminal/blob/master/archetypes/posts.md
|
||||
|
||||
## Add-ons
|
||||
|
||||
|
@ -8,4 +8,5 @@ tags = ["", ""]
|
||||
keywords = ["", ""]
|
||||
description = ""
|
||||
showFullContent = false
|
||||
readingTime = false
|
||||
+++
|
||||
|
@ -5,12 +5,18 @@
|
||||
<div class="post-meta">
|
||||
{{ if .Params.Date }}
|
||||
<span class="post-date">
|
||||
{{ .Date.Format "2006-01-02" }} {{ if $.Site.Params.showLastUpdated }}[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]{{ end }}
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
{{ if $.Site.Params.showLastUpdated }}
|
||||
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">:: {{ . }}</span>
|
||||
{{ end }}
|
||||
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
|
||||
<span class="post-reading-time">:: {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user