allow setting ShowReadingTime per-page

as well as site-wide
This commit is contained in:
Aditya Telange 2021-01-24 18:07:17 +05:30
parent bc4d4153dc
commit f7dbf75d5b
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@
<div class="post-meta">
{{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}
{{- if or .Params.author $.Site.Params.author $.Site.Params.ShowReadingTime (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}

View File

@ -4,7 +4,7 @@
{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
{{- end -}}
{{- if $.Site.Params.ShowReadingTime -}}
{{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime))) }}
{{- end -}}