list.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {{ $item := .item }}
  2. {{/* Dynamic view adjusts to content type. */}}
  3. {{ $icon_pack := "far" }}
  4. {{ $icon := "fa-file-alt" }}
  5. {{ $show_authors := false }}
  6. {{ $link := $item.RelPermalink }}
  7. {{ $target := "" }}
  8. {{ if $item.Params.external_link }}
  9. {{ $link = $item.Params.external_link }}
  10. {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
  11. {{ end }}
  12. {{ if eq $item.Type "post" }}
  13. {{ $icon = "fa-newspaper" }}
  14. {{ else if eq $item.Type "event" }}
  15. {{ $icon = "fa-calendar-alt" }}
  16. {{ else if eq $item.Type "publication" }}
  17. {{ $show_authors = true }}
  18. {{ else if eq $item.Type "project" }}
  19. {{ $icon_pack = "fas" }}
  20. {{ $icon = "fa-project-diagram" }}
  21. {{ $show_authors = true }}
  22. {{ end }}
  23. {{ $has_attachments := partial "functions/has_attachments" . }}
  24. <div class="view-list view-list-item">
  25. <i class="{{$icon_pack}} {{$icon}} pub-icon" aria-hidden="true"></i>
  26. <a href="{{$link}}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a>
  27. {{ if eq $item.Type "event" }}
  28. <div class="article-metadata">
  29. <span>
  30. {{ partial "functions/get_event_dates" $item }}
  31. </span>
  32. {{ with $item.Params.location }}
  33. <span class="middot-divider"></span>
  34. <span>{{ . }}</span>
  35. {{ end }}
  36. </div>
  37. {{ end }}
  38. {{ if and $show_authors $item.Params.authors }}
  39. <div class="article-metadata">
  40. {{ partial "page_metadata_authors" $item }}
  41. </div>
  42. {{ end }}
  43. {{ if $has_attachments }}
  44. <div class="btn-links">
  45. {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  46. </div>
  47. {{ end }}
  48. </div>