li_list.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {{ $item := . }}
  2. {{ $microdata_type := "http://schema.org/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 = "http://schema.org/BlogPosting" }}
  9. {{ $icon = "fa-newspaper" }}
  10. {{ else if eq $item.Type "talk" }}
  11. {{ $microdata_type = "http://schema.org/Event" }}
  12. {{ $icon = "fa-calendar-alt" }}
  13. {{ else if eq $item.Type "publication" }}
  14. {{ $show_authors = true }}
  15. {{ $show_buttons = true }}
  16. {{ end }}
  17. <div class="view-list-item" itemscope itemtype="{{$microdata_type}}">
  18. <i class="far {{$icon}} pub-icon" aria-hidden="true"></i>
  19. <a href="{{ $item.RelPermalink }}" itemprop="url"><span itemprop="name">{{ $item.Title }}</span></a>
  20. {{ if eq $item.Type "talk" }}
  21. <div class="article-metadata">
  22. <span itemprop="startDate">
  23. {{ $date := $item.Params.time_start | default $item.Date }}
  24. {{ (time $date).Format $.Site.Params.date_format }}
  25. {{ if not $item.Params.all_day }}
  26. {{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
  27. {{ end }}
  28. </span>
  29. {{ with $item.Params.location }}
  30. <span class="middot-divider"></span>
  31. <span itemprop="location">{{ . }}</span>
  32. {{ end }}
  33. </div>
  34. {{ end }}
  35. {{ if $show_authors }}
  36. <div class="article-metadata" itemprop="author">
  37. {{ partial "page_metadata_authors" $item }}
  38. </div>
  39. {{ end }}
  40. {{ if $show_buttons }}
  41. <div class="btn-links">
  42. {{ partial "page_links" (dict "content" $item "is_list" 1) }}
  43. </div>
  44. {{ end }}
  45. </div>