li_card.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{ $item := . }}
  2. {{/* Dynamic view adjusts to content type. */}}
  3. {{ $show_buttons := false }}
  4. {{ if eq $item.Type "talk" }}
  5. {{ $show_buttons = true }}
  6. {{ else if eq $item.Type "publication" }}
  7. {{ $show_buttons = true }}
  8. {{ end }}
  9. {{/* Get summary. */}}
  10. {{ $summary := "" }}
  11. {{ if $item.Params.summary }}
  12. {{ $summary = $item.Params.summary | markdownify | emojify }}
  13. {{ else if .Params.abstract }}
  14. {{ $summary = .Params.abstract | markdownify | emojify }}
  15. {{ else if $item.Summary }}
  16. {{ $summary = $item.Summary }}
  17. {{ end }}
  18. <div class="card-simple">
  19. {{ if eq $item.Type "talk" }}
  20. <div class="article-metadata">
  21. {{ if $item.Params.authors }}
  22. <div>
  23. {{ partial "page_metadata_authors" $item }}
  24. </div>
  25. {{ end }}
  26. <span>
  27. {{ partial "functions/get_event_dates" $item }}
  28. </span>
  29. {{ with $item.Params.location }}
  30. <span class="middot-divider"></span>
  31. <span>{{ . }}</span>
  32. {{ end }}
  33. </div>
  34. {{ else }}
  35. {{ partial "page_metadata" (dict "page" $item "is_list" 1) }}
  36. {{ end }}
  37. {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
  38. {{ $anchor := $item.Params.image.focal_point | default "Smart" }}
  39. {{ with $resource }}
  40. {{ $image := .Fill (printf "918x517 q90 %s" $anchor) }}
  41. <a href="{{ $item.RelPermalink }}">
  42. <img src="{{ $image.RelPermalink }}" class="article-banner" alt="{{ $item.Title }}">
  43. </a>
  44. {{end}}
  45. <h3 class="article-title mb-1 mt-3">
  46. <a href="{{ $item.RelPermalink }}">{{ $item.Title }}</a>
  47. </h3>
  48. {{ with $summary }}
  49. <a href="{{ $item.RelPermalink }}" class="summary-link">
  50. <div class="article-style">
  51. <p>{{.}}</p>
  52. </div>
  53. </a>
  54. {{ end }}
  55. {{ if $show_buttons }}
  56. <div class="btn-links">
  57. {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  58. </div>
  59. {{ end }}
  60. </div>