project_li_showcase.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. {{ $order := "" }}
  12. {{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool .index 2)) }}
  13. {{ $order = "order-md-2" }}
  14. {{ end }}
  15. {{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
  16. <div class="col-lg-12 project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}" itemscope itemtype="http://schema.org/CreativeWork">
  17. <div class="row align-items-center">
  18. <div class="col-12 col-md-6">
  19. <h3 class="article-title mb-0 mt-0" itemprop="name">
  20. {{- if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }} itemprop="url">{{end -}}
  21. {{ $item.Title | markdownify | emojify }}
  22. {{- if $do_link}}</a>{{end -}}
  23. </h3>
  24. {{ $summary := "" }}
  25. {{ if $item.Params.summary }}
  26. {{ $summary = $item.Params.summary }}
  27. {{ else if $item.Truncated }}
  28. {{ $summary = $item.Summary }}
  29. {{ end }}
  30. {{ with $summary }}
  31. <div class="article-style" itemprop="articleBody">
  32. {{ . | markdownify | emojify }}
  33. </div>
  34. {{ end }}
  35. <div class="btn-links">
  36. {{ partial "page_links" (dict "content" $item "is_list" 0) }}
  37. </div>
  38. </div>
  39. <div class="col-12 col-md-6 order-first {{$order}}">
  40. {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
  41. {{ with $resource }}
  42. {{ $image := .Resize "540x" }}
  43. {{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
  44. <img src="{{ $image.RelPermalink }}" itemprop="image" alt="">
  45. {{if $do_link}}</a>{{end}}
  46. {{end}}
  47. </div>
  48. </div>
  49. </div>