Add params for hiding date and reading time per article

This commit is contained in:
James Panther
2021-08-16 14:05:46 +10:00
parent 5575d2b43e
commit 7ce10997ce
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -1,16 +1,16 @@
{{ if .Site.Params.article.showDate | default true }}
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
<time datetime="{{ .Date }}">
{{ .Date.Format .Site.Params.article.dateFormat | default "2 January 2006" }}
</time>
{{ 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)
}}
<span class="px-1">&middot;</span>
{{ 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) }}
<span title="Reading time">
{{ .ReadingTime }}
min{{ if gt .ReadingTime 1 }}s{{ end }}