mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2025-03-15 02:39:06 +03:00
add reading time param
This commit is contained in:
parent
bbaf93ff6f
commit
0c08f72167
8 changed files with 15 additions and 8 deletions
|
@ -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,11 +5,17 @@
|
|||
<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>
|
||||
<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>
|
||||
|
||||
|
|
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…
Add table
Reference in a new issue