From f7dbf75d5b91cbe97bb82579aad8defa98c42402 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sun, 24 Jan 2021 18:07:17 +0530
Subject: [PATCH] allow setting ShowReadingTime per-page as well as site-wide
---
layouts/_default/single.html | 2 +-
layouts/partials/post_meta.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index d9761983..84b70d5d 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -13,7 +13,7 @@
{{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}
- {{- if or .Params.author $.Site.Params.author $.Site.Params.ShowReadingTime (not .Date.IsZero) }} | {{- end -}}
+ {{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}}
{{- i18n "translations" | default "Translations"}}:
{{- range .Translations }}
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index e0dbef40..d0cf1761 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 -}}