blog

Log | Files | Refs

post_meta.html (967B)


      1 {{- $scratch := newScratch }}
      2 
      3 {{- if not .Date.IsZero -}}
      4     {{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
      5 {{- end }}
      6 
      7 {{- if (.Param "ShowReadingTime") -}}
      8     {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }}
      9 {{- end }}
     10 
     11 {{- if (.Param "ShowWordCount") -}}
     12     {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }}
     13 {{- end }}
     14 
     15 {{- if not (.Param "hideAuthor") -}}
     16     {{- with (partial "author.html" .) }}
     17         {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" .)) }}
     18     {{- end }}
     19 {{- end }}
     20 
     21 {{/* Combine all meta information into a single string with separators and render it as HTML.*/}}
     22 
     23 {{- with ($scratch.Get "meta") }}
     24     {{- delimit . "&nbsp;ยท&nbsp;" | safeHTML -}}
     25 {{- end -}}