li_list.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {{ $item := . }}
  2. {{ $microdata_type := "CreativeWork" }}
  3. {{ $icon := "fa-file-alt" }}
  4. {{ $show_authors := false }}
  5. {{ $show_buttons := false }}
  6. {{/* Dynamic view adjusts to content type. */}}
  7. {{ if eq $item.Type "post" }}
  8. {{ $microdata_type = "BlogPosting" }}
  9. {{ $icon = "fa-newspaper" }}
  10. {{ else if eq $item.Type "talk" }}
  11. {{ $microdata_type = "Event" }}
  12. {{ $icon = "fa-calendar-alt" }}
  13. {{ else if eq $item.Type "publication" }}
  14. {{ $microdata_type = "ScholarlyArticle" }}
  15. {{ $show_authors = true }}
  16. {{ $show_buttons = true }}
  17. {{ end }}
  18. <div class="view-list-item" itemscope itemtype="http://schema.org/{{$microdata_type}}">
  19. <i class="far {{$icon}} pub-icon" aria-hidden="true"></i>
  20. <a href="{{ $item.RelPermalink }}" itemprop="url"><span itemprop="name">{{ $item.Title }}</span></a>
  21. {{ if eq $item.Type "talk" }}
  22. <div class="article-metadata">
  23. <span itemprop="startDate">
  24. {{ $date := $item.Date }}
  25. {{ (time $date).Format site.Params.date_format }}
  26. {{ if not $item.Params.all_day }}
  27. {{ (time $date).Format (site.Params.time_format | default "3:04 PM") }}
  28. {{ with $item.Params.date_end }}
  29. &mdash; {{ (time .).Format (site.Params.time_format | default "3:04 PM") }}
  30. {{ end }}
  31. {{ end }}
  32. </span>
  33. {{ with $item.Params.location }}
  34. <span class="middot-divider"></span>
  35. <span itemprop="location">{{ . }}</span>
  36. {{ end }}
  37. </div>
  38. {{ end }}
  39. {{ if and $show_authors $item.Params.authors }}
  40. <div class="article-metadata" itemprop="author">
  41. {{ partial "page_metadata_authors" $item }}
  42. </div>
  43. {{ end }}
  44. {{ if $show_buttons }}
  45. <div class="btn-links">
  46. {{ partial "page_links" (dict "content" $item "is_list" 1) }}
  47. </div>
  48. {{ end }}
  49. </div>