portfolio_li_card.html 1.5 KB

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