li_list.html 1.5 KB

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