mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Merge pull request #2216 from ZhenShuo2021/fix/showDate
🐛 Fix: date still shown when showDate=false
This commit is contained in:
@@ -12,9 +12,19 @@
|
|||||||
{{ $meta := newScratch }}
|
{{ $meta := newScratch }}
|
||||||
|
|
||||||
{{/* Gather partials for this context */}}
|
{{/* Gather partials for this context */}}
|
||||||
|
{{ $shouldShowDate := false }}
|
||||||
|
{{ if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
|
||||||
|
{{ $shouldShowDate = true }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* showDate has higher priority than showDateOnlyInArticle */}}
|
||||||
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
|
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
|
||||||
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
|
{{ $shouldShowDate = true }}
|
||||||
{{else if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
|
{{ else }}
|
||||||
|
{{ $shouldShowDate = false }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if $shouldShowDate }}
|
||||||
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
|
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user