From 7ce10997ce9723859880aa8c6b923199a665f230 Mon Sep 17 00:00:00 2001
From: James Panther <4462786+jpanther@users.noreply.github.com>
Date: Mon, 16 Aug 2021 14:05:46 +1000
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20params=20for=20hiding=20date?=
=?UTF-8?q?=20and=20reading=20time=20per=20article?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layouts/partials/article-meta.html | 8 ++++----
layouts/partials/article-pagination.html | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/layouts/partials/article-meta.html b/layouts/partials/article-meta.html
index 6e6f2e3e..0718f513 100644
--- a/layouts/partials/article-meta.html
+++ b/layouts/partials/article-meta.html
@@ -1,16 +1,16 @@
-{{ if .Site.Params.article.showDate | default true }}
+{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ end }}
{{ if and
- (.Site.Params.article.showDate | default true)
- (.Site.Params.article.showReadingTime | default true)
+ (.Params.showDate | default (.Site.Params.article.showDate | default true))
+ (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true))
(ne .ReadingTime 0)
}}
·
{{ end }}
-{{ if and (.Site.Params.article.showReadingTime | default true) (ne .ReadingTime 0) }}
+{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
{{ .ReadingTime }}
min{{ if gt .ReadingTime 1 }}s{{ end }}
diff --git a/layouts/partials/article-pagination.html b/layouts/partials/article-pagination.html
index 5f382d94..30457cf4 100644
--- a/layouts/partials/article-pagination.html
+++ b/layouts/partials/article-pagination.html
@@ -9,7 +9,7 @@
←
{{ .NextInSection.Title }}
- {{ if .Site.Params.article.showDate | default true }}
+ {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}