page_metadata.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "talk" "page") $page.Type) }}
  14. <span class="article-date">
  15. {{ $date := $page.Lastmod.Format site.Params.date_format }}
  16. {{ if eq $page.Type "publication" }}
  17. {{ $date = $page.Date.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. {{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable $page.Type) | and (ne $page.Params.commentable false) | or $page.Params.commentable }}
  44. {{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
  45. <span class="middot-divider"></span>
  46. <a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
  47. {{ end}}
  48. {{ $taxonomy := "categories" }}
  49. {{ if $page.Param $taxonomy }}
  50. <span class="middot-divider"></span>
  51. <span class="article-categories">
  52. <i class="fas fa-folder mr-1"></i>
  53. {{- range $index, $value := ($page.GetTerms $taxonomy) -}}
  54. {{- if gt $index 0 }}, {{ end -}}
  55. <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
  56. {{- end -}}
  57. </span>
  58. {{ end }}
  59. </div>