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