portfolio_li_card.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {{ $item := .item }}
  2. {{ $widget := .widget }}
  3. {{ $link := .link }}
  4. {{ $target := .target }}
  5. {{/* Get summary. */}}
  6. {{ $summary := "" }}
  7. {{ if $item.Params.summary }}
  8. {{ $summary = $item.Params.summary | markdownify | emojify }}
  9. {{ else if .Params.abstract }}
  10. {{ $summary = .Params.abstract | markdownify | emojify | truncate (site.Params.abstract_length | default 135) }}
  11. {{ else if $item.Summary }}
  12. {{ $summary = $item.Summary }}
  13. {{ end }}
  14. {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
  15. {{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
  16. <div class="project-card project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}">
  17. <div class="card">
  18. {{ with $resource }}
  19. {{ $image := .Resize (printf "550x q90 %s") }}
  20. <a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="card-image hover-overlay">
  21. <img src="{{ $image.RelPermalink }}" alt="" class="img-responsive">
  22. </a>
  23. {{ end }}
  24. <div class="card-text">
  25. <h4><a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{ $item.Title | markdownify | emojify }}</a></h4>
  26. {{ with $summary }}
  27. <div class="article-style">
  28. <p>{{ . }}</p>
  29. </div>
  30. {{ end }}
  31. </div>
  32. </div>
  33. </div>