summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-01-24 18:07:17 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-01-24 18:08:15 +0530
commitf7dbf75d5b91cbe97bb82579aad8defa98c42402 (patch)
tree3db961c07daea3ea20b42f56a00c2cdf66b9e6d0 /layouts
parentbc4d4153dc4eb114c1c4fbca3615d21eac13e7b2 (diff)
allow setting ShowReadingTime per-page
as well as site-wide
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/partials/post_meta.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index d976198..84b70d5 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -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 }}
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index e0dbef4..d0cf176 100644
--- a/layouts/partials/post_meta.html
+++ b/layouts/partials/post_meta.html
@@ -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 -}}