mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
Merge pull request #2565 from ZhenShuo2021/fix/showDateOnlyInArticle
🐛 Fix: showDateOnlyInArticle
This commit is contained in:
@@ -13,17 +13,19 @@
|
|||||||
|
|
||||||
{{/* Gather partials for this context */}}
|
{{/* Gather partials for this context */}}
|
||||||
{{ $shouldShowDate := false }}
|
{{ $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) }}
|
||||||
{{ $shouldShowDate = true }}
|
{{ $shouldShowDate = true }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $shouldShowDate = false }}
|
{{ $shouldShowDate = false }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
|
||||||
|
{{ if (ne $scope "single") }}
|
||||||
|
{{/* only takes effect when not called directly in the header of single.html */}}
|
||||||
|
{{ $shouldShowDate = false }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if $shouldShowDate }}
|
{{ 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