post_li_card.html 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. {{ $post := . }}
  2. <div class="card-simple" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">
  3. {{ partial "page_metadata" (dict "content" $post "is_list" 1) }}
  4. {{ $resource := ($post.Resources.ByType "image").GetMatch "*featured*" }}
  5. {{ $anchor := $post.Params.image.focal_point | default "Smart" }}
  6. {{ with $resource }}
  7. {{ $image := .Fill (printf "918x517 q90 %s" $anchor) }}
  8. <a href="{{ $post.RelPermalink }}">
  9. <img src="{{ $image.RelPermalink }}" class="article-banner" itemprop="image" alt="">
  10. </a>
  11. {{end}}
  12. <h3 class="article-title" itemprop="headline">
  13. <a href="{{ $post.RelPermalink }}" itemprop="url">{{ $post.Title }}</a>
  14. </h3>
  15. <div class="article-style" itemprop="articleBody">
  16. {{ if $post.Params.summary }}
  17. <p>{{ printf "%s" $post.Params.summary | markdownify }}</p>
  18. {{ else if $post.Truncated }}
  19. {{ $post.Summary }}
  20. {{ else }}
  21. {{ $post.Content }}
  22. {{ end }}
  23. </div>
  24. <p class="read-more" itemprop="mainEntityOfPage">
  25. <a href="{{ $post.RelPermalink }}" class="btn btn-outline-primary my-1">
  26. {{ i18n "continue_reading" }}
  27. </a>
  28. </p>
  29. </div>