post_meta.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <span class="post-meta">
  2. {{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }}
  3. {{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }}
  4. <i class="fas fa-calendar"></i>&nbsp;{{ $datestr | i18n "postedOnDate"}}
  5. {{ if ne $datestr $lastmodstr }}
  6. &nbsp;{{ $lastmodstr | i18n "lastModified" }}
  7. {{ end }}
  8. {{ if .Site.Params.readingTime }}
  9. &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;{{ i18n "readingTime"}}{{ .ReadingTime }}&nbsp;{{ i18n "readTime" }}
  10. {{ end }}
  11. {{ if .Site.Params.wordCount }}
  12. &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;{{ .WordCount }}&nbsp;{{ i18n "words" }}
  13. {{ end }}
  14. {{ if not .Site.Params.hideAuthor }}
  15. {{ if .Params.author }}
  16. {{ if reflect.IsSlice .Params.author }}
  17. {{ range .Params.author }}
  18. &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ . | safeHTML }}
  19. {{ end }}
  20. {{ else }}
  21. &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Params.author | safeHTML }}
  22. {{ end }}
  23. {{ else }}
  24. &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Site.Params.author.name | safeHTML }}
  25. {{ end }}
  26. {{ end }}
  27. {{- if .Site.Params.staticman -}}
  28. &nbsp;|&nbsp;<i class="fas fa-comment"></i>&nbsp;
  29. {{ $slug := replace .RelPermalink "/" "" }}
  30. {{ if .Site.Data.comments }}
  31. {{ $comments := index $.Site.Data.comments $slug }}
  32. {{ if $comments }}
  33. {{ if gt (len $comments) 1 }}
  34. {{ len $comments }} {{ i18n "moreComment" }}
  35. {{ else }}
  36. {{ len $comments }} {{ i18n "oneComment" }}
  37. {{ end }}
  38. {{ else }}
  39. 0 {{ i18n "oneComment" }}
  40. {{ end }}
  41. {{ end }}
  42. {{ end }}
  43. {{ if .IsTranslated -}}
  44. {{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
  45. {{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
  46. {{- $cleanLinks := apply $links "chomp" "." -}}
  47. {{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}}
  48. &nbsp;&bull;&nbsp;{{ i18n "translationsLabel" }}{{ $linksOutput | safeHTML }}
  49. {{- end }}
  50. </span>