li_compact.html 2.4 KB

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