portfolio_li_showcase.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {{ $item := .item }}
  2. {{ $widget := .widget }}
  3. {{ $do_link := true }}
  4. {{ if $item.Params.external_link | or $item.Content }}
  5. {{ $do_link = true }}
  6. {{ else }}
  7. {{ $do_link = false }}
  8. {{ end }}
  9. {{ $link := .link }}
  10. {{ $target := .target }}
  11. {{/* Get summary. */}}
  12. {{ $summary := "" }}
  13. {{ if $item.Params.summary }}
  14. {{ $summary = $item.Params.summary | markdownify | emojify }}
  15. {{ else if .Params.abstract }}
  16. {{ $summary = .Params.abstract | markdownify | emojify }}
  17. {{ else if $item.Summary }}
  18. {{ $summary = $item.Summary }}
  19. {{ end }}
  20. {{ $order := "" }}
  21. {{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool .index 2)) }}
  22. {{ $order = "order-md-2" }}
  23. {{ end }}
  24. {{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
  25. <div class="col-lg-12 project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}">
  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" }}
  46. {{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
  47. <img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" loading="lazy">
  48. {{if $do_link}}</a>{{end}}
  49. {{end}}
  50. </div>
  51. </div>
  52. </div>