li_list.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {{ $item := . }}
  2. {{ $microdata_type := "CreativeWork" }}
  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. {{/* Dynamic view adjusts to content type. */}}
  14. {{ if eq $item.Type "post" }}
  15. {{ $microdata_type = "BlogPosting" }}
  16. {{ $icon = "fa-newspaper" }}
  17. {{ else if eq $item.Type "talk" }}
  18. {{ $microdata_type = "Event" }}
  19. {{ $icon = "fa-calendar-alt" }}
  20. {{ else if eq $item.Type "publication" }}
  21. {{ $microdata_type = "ScholarlyArticle" }}
  22. {{ $show_authors = true }}
  23. {{ $show_buttons = true }}
  24. {{ else if eq $item.Type "project" }}
  25. {{ $microdata_type = "CreativeWork" }}
  26. {{ $icon_pack = "fas" }}
  27. {{ $icon = "fa-project-diagram" }}
  28. {{ $show_authors = true }}
  29. {{ $show_buttons = true }}
  30. {{ end }}
  31. <div class="view-list-item" itemscope itemtype="http://schema.org/{{$microdata_type}}">
  32. <i class="{{$icon_pack}} {{$icon}} pub-icon" aria-hidden="true"></i>
  33. <a href="{{$link}}" {{ $target | safeHTMLAttr }} itemprop="url"><span itemprop="name">{{ $item.Title }}</span></a>
  34. {{ if eq $item.Type "talk" }}
  35. <div class="article-metadata">
  36. <span itemprop="startDate">
  37. {{ partial "functions/get_event_dates" $item }}
  38. </span>
  39. {{ with $item.Params.location }}
  40. <span class="middot-divider"></span>
  41. <span itemprop="location">{{ . }}</span>
  42. {{ end }}
  43. </div>
  44. {{ end }}
  45. {{ if and $show_authors $item.Params.authors }}
  46. <div class="article-metadata" itemprop="author">
  47. {{ partial "page_metadata_authors" $item }}
  48. </div>
  49. {{ end }}
  50. {{ if $show_buttons }}
  51. <div class="btn-links">
  52. {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  53. </div>
  54. {{ end }}
  55. </div>