mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-25 12:01:37 +01:00
post-meta: fix redundant '·'(separator) in end
when author is not present
This commit is contained in:
parent
db0e744af3
commit
3e84ff0435
@ -1,11 +1,17 @@
|
|||||||
|
{{- $scratch := newScratch}}
|
||||||
|
|
||||||
{{- if not .Date.IsZero -}}
|
{{- if not .Date.IsZero -}}
|
||||||
<time>{{- .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time> ·
|
{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if $.Site.Params.ShowReadingTime -}}
|
{{- if $.Site.Params.ShowReadingTime -}}
|
||||||
{{- i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime) }} ·
|
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime))) }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if or .Params.author .Site.Params.author }}
|
{{- if or .Params.author .Site.Params.author }}
|
||||||
{{- printf "%s" (.Params.author | default .Site.Params.author) }}
|
{{- $scratch.Add "meta" (slice (.Params.author | default .Site.Params.author)) }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with ($scratch.Get "meta")}}
|
||||||
|
{{- delimit . " · "}}
|
||||||
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user