portfolio_li_showcase.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. <h3 class="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. </h3>
  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. {{ $filters := slice (images.GaussianBlur 21) (images.Pixelate 8) }}
  46. {{ $image := .Resize "540x" }}
  47. {{ $image_lq := (.Resize "540x q1").Filter $filters }}
  48. {{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
  49. <img src="{{ $image_lq.RelPermalink }}" data-src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" class="lazyload">
  50. {{if $do_link}}</a>{{end}}
  51. {{end}}
  52. </div>
  53. </div>
  54. </div>