page_metadata.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{ $is_list := .is_list }}
  2. {{ $page := .page }}
  3. <div class="article-metadata">
  4. {{/* If `authors` is set and is not empty. */}}
  5. {{ if $page.Params.authors }}
  6. {{ $authorLen := len $page.Params.authors }}
  7. {{ if gt $authorLen 0 }}
  8. <div>
  9. {{ partial "page_metadata_authors" $page }}
  10. </div>
  11. {{ end }}
  12. {{ end }}
  13. {{ if not (in (slice "event" "page") $page.Type) | and (ne $page.Params.show_date false) }}
  14. <span class="article-date">
  15. {{ $date := $page.Lastmod | time.Format site.Params.locale.date_format }}
  16. {{ if eq $page.Type "publication" }}
  17. {{ $date = $page.Date | time.Format (site.Params.publications.date_format | default "January, 2006") }}
  18. {{ else }}
  19. {{ if ne $page.Params.Lastmod $page.Params.Date }}
  20. {{ i18n "last_updated" }}
  21. {{ end }}
  22. {{ end }}
  23. {{ $date }}
  24. </span>
  25. {{ end }}
  26. {{ if and (eq $is_list 1) (eq $page.Type "publication") }}
  27. <span class="middot-divider"></span>
  28. <span class="pub-publication">
  29. {{ if $page.Params.publication_short }}
  30. {{ $page.Params.publication_short | markdownify }}
  31. {{ else if $page.Params.publication }}
  32. {{ $page.Params.publication | markdownify }}
  33. {{ end }}
  34. </span>
  35. {{ end }}
  36. {{ if and (eq $page.Type "post") (not (or (eq site.Params.reading_time false) (eq $page.Params.reading_time false))) }}
  37. <span class="middot-divider"></span>
  38. <span class="article-reading-time">
  39. {{ $page.ReadingTime }} {{ i18n "minute_read" }}
  40. </span>
  41. {{ end }}
  42. {{/* Show Disqus comment count if enabled. */}}
  43. {{ $comments_provider := trim (site.Params.features.comment.provider | lower) " " }}
  44. {{ $commentable_page := $page.Params.commentable }}
  45. {{ if (eq $comments_provider "disqus") | and (site.Params.features.comment.disqus.show_count | default true) | and $commentable_page }}
  46. <span class="middot-divider"></span>
  47. <a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
  48. {{ end}}
  49. {{ $taxonomy := "categories" }}
  50. {{ if $page.Param $taxonomy }}
  51. <span class="middot-divider"></span>
  52. <span class="article-categories">
  53. <i class="fas fa-folder mr-1"></i>
  54. {{- range $index, $value := ($page.GetTerms $taxonomy) -}}
  55. {{- if gt $index 0 }}, {{ end -}}
  56. <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
  57. {{- end -}}
  58. </span>
  59. {{ end }}
  60. </div>