li_compact.html 2.6 KB

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