li_card.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {{ $item := . }}
  2. {{/* Dynamic view adjusts to content type. */}}
  3. {{ $show_buttons := false }}
  4. {{ if eq $item.Type "event" }}
  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 "event" }}
  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. {{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
  41. {{ $image := .Fill (printf "808x455 %s" $anchor) }}
  42. {{ $image_lq := (.Fill (printf "808x455 %s q1" $anchor)).Filter $filters }}
  43. <a href="{{ $item.RelPermalink }}">
  44. <div class="img-hover-zoom"><img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" class="article-banner lazyload" alt="{{ $item.Title }}"></div>
  45. </a>
  46. {{end}}
  47. <h3 class="article-title mb-1 mt-3">
  48. <a href="{{ $item.RelPermalink }}">{{ $item.Title }}</a>
  49. </h3>
  50. {{ with $summary }}
  51. <a href="{{ $item.RelPermalink }}" class="summary-link">
  52. <div class="article-style">
  53. <p>{{.}}</p>
  54. </div>
  55. </a>
  56. {{ end }}
  57. {{ if $show_buttons }}
  58. <div class="btn-links">
  59. {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  60. </div>
  61. {{ end }}
  62. </div>