li_compact.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {{ $item := . }}
  2. {{ $microdata_type := "CreativeWork" }}
  3. {{ $show_authors_only := false }}{{/* Show authors only or full metadata? */}}
  4. {{ $show_buttons := false }}
  5. {{/* Dynamic view adjusts to content type. */}}
  6. {{ if eq $item.Type "post" }}
  7. {{ $microdata_type = "BlogPosting" }}
  8. {{ else if eq $item.Type "talk" }}
  9. {{ $microdata_type = "Event" }}
  10. {{ $show_authors_only = true }}
  11. {{ $show_buttons = true }}
  12. {{ else if eq $item.Type "publication" }}
  13. {{ $microdata_type = "ScholarlyArticle" }}
  14. {{ $show_authors_only = true }}
  15. {{ $show_buttons = true }}
  16. {{ end }}
  17. {{/* Get summary. */}}
  18. {{ $summary := "" }}
  19. {{ if $item.Params.summary }}
  20. {{ $summary = $item.Params.summary | markdownify | emojify }}
  21. {{ else if .Params.abstract }}
  22. {{ $summary = .Params.abstract | markdownify | emojify }}
  23. {{ else if $item.Truncated }}
  24. {{ $summary = $item.Summary }}
  25. {{ end }}
  26. <div class="media stream-item" itemscope itemtype="http://schema.org/{{$microdata_type}}">
  27. <div class="media-body">
  28. <h3 class="article-title mb-0 mt-0" itemprop="name">
  29. <a href="{{ $item.RelPermalink }}" itemprop="url">{{ $item.Title }}</a>
  30. </h3>
  31. {{ with $summary }}
  32. <div class="article-style" itemprop="articleBody">
  33. {{ . | truncate 135 }}
  34. </div>
  35. {{ end }}
  36. <div class="stream-meta article-metadata">
  37. {{ if eq $item.Type "talk" }}
  38. <div>
  39. <span itemprop="startDate">
  40. {{ partial "functions/get_event_dates" $item }}
  41. </span>
  42. {{ with $item.Params.location }}
  43. <span class="middot-divider"></span>
  44. <span itemprop="location">{{ . }}</span>
  45. {{ end }}
  46. </div>
  47. {{ end }}
  48. {{ if and $show_authors_only $item.Params.authors }}
  49. <div itemprop="author">
  50. {{ partial "page_metadata_authors" $item }}
  51. </div>
  52. {{ else if not $show_authors_only }}
  53. {{ partial "page_metadata" (dict "page" $item "is_list" 1) }}
  54. {{ end }}
  55. </div>
  56. {{ if $show_buttons }}
  57. <div class="btn-links">
  58. {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  59. </div>
  60. {{ end }}
  61. </div>
  62. <div class="ml-3">
  63. {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
  64. {{ with $resource }}
  65. {{ $image := .Resize "150x" }}
  66. <a href="{{ $item.RelPermalink }}">
  67. <img src="{{ $image.RelPermalink }}" itemprop="image">
  68. </a>
  69. {{end}}
  70. </div>
  71. </div>