Files
2026-11-14 19:45:55 +08:00

26 lines
965 B
HTML

{{- $meta := slice }}
{{- if not .Date.IsZero -}}
{{- $meta = $meta | append (printf "<span title='%s'>%s</span>" (.Date | time.Format "2006-01-02T15:04:05-07:00") (.Date | time.Format (default ":date_long" site.Params.DateFormat))) }}
{{- end }}
{{- if (.Param "ShowReadingTime") -}}
{{- $meta = $meta | append (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }}
{{- if (.Param "ShowWordCount") -}}
{{- $meta = $meta | append (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
{{- end }}
{{- if not (.Param "hideAuthor") -}}
{{- with (partial "author.html" .) }}
{{- $meta = $meta | append (printf "<span>%s</span>" .) }}
{{- end }}
{{- end }}
{{/* Combine all meta information into a single string with separators and render it as HTML.*/}}
{{- with $meta }}
{{- delimit . "&nbsp;·&nbsp;" | safeHTML -}}
{{- end -}}