li_card.html 1.8 KB

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