add reading time param

This commit is contained in:
panr
2021-10-24 10:43:59 +02:00
parent bbaf93ff6f
commit 0c08f72167
8 changed files with 15 additions and 8 deletions

View File

@ -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>