showcase.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {{ $item := .item }}
  2. {{ $widget := .page }}
  3. {{ $index := .index }}
  4. {{ $do_link := true }}
  5. {{ if $item.Params.external_link | or $item.Content }}
  6. {{ $do_link = true }}
  7. {{ else }}
  8. {{ $do_link = false }}
  9. {{ end }}
  10. {{ $link := $item.Params.external_link | default $item.RelPermalink }}
  11. {{ $target := .target }}
  12. {{/* Get summary. */}}
  13. {{ $summary := "" }}
  14. {{ if $item.Params.summary }}
  15. {{ $summary = $item.Params.summary | markdownify | emojify }}
  16. {{ else if .Params.abstract }}
  17. {{ $summary = .Params.abstract | markdownify | emojify }}
  18. {{ else if $item.Summary }}
  19. {{ $summary = $item.Summary }}
  20. {{ end }}
  21. {{ $order := "" }}
  22. {{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
  23. {{ $order = "order-md-2" }}
  24. {{ end }}
  25. <div class="col-lg-12 mb-5 view-showcase">
  26. <div class="row align-items-center">
  27. <div class="col-12 col-md-6">
  28. <div class="section-subheading article-title mb-0 mt-0">
  29. {{- if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end -}}
  30. {{ $item.Title | markdownify | emojify }}
  31. {{- if $do_link}}</a>{{end -}}
  32. </div>
  33. {{ with $summary }}
  34. <div class="article-style">
  35. {{ . }}
  36. </div>
  37. {{ end }}
  38. <div class="btn-links">
  39. {{ partial "page_links" (dict "page" $item "is_list" 0) }}
  40. </div>
  41. </div>
  42. <div class="col-12 col-md-6 order-first {{$order}}">
  43. {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
  44. {{ with $resource }}
  45. {{ $image := .Resize "540x webp" }}
  46. {{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
  47. <img src="{{ $image.RelPermalink }}" height="{{ $image.Height }}" width="{{ $image.Width }}"
  48. alt="{{ $item.Title }}" loading="lazy">
  49. {{if $do_link}}</a>{{end}}
  50. {{end}}
  51. </div>
  52. </div>
  53. </div>