You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pages/layouts/partials/list-item-thumbnail.html

27 lines
1.0 KiB
HTML

{{ with .Param "fa-thumbnail" }}
<div class="thumb-icon-wrapper mb-3">
<span class="badge thumb-icon-badge rounded-pill bg-primary py-4 px-5">
<i class="fa-fw {{ . }}"></i>
</span>
</div>
{{ end }}
{{/* Thumbnail images should be stored as 'thumbnail'.* in the page bundle, but
historically they might have been referenced as 'thumbnail' in the front
matter, or (even more historically) as 'cardImage'. Use scratch to
normalize all these different systems.
*/}}
{{ $bundleGlob := "thumbnail.*" }}
{{ $frontThumbGlob := print "images/" (.Params.thumbnail) ".*" }}
{{ $frontCardGlob := print "images/" (.Params.cardImage) ".jpg" }}
{{ $allThumbnailGlob := print "{" $frontThumbGlob "," $frontCardGlob "," $bundleGlob "}" }}
{{ with .Resources.GetMatch $allThumbnailGlob }}
{{ $thumbnail := . }}
{{ $thumbnailResized := $thumbnail.Resize "600x" }}
<img
class="img img-thumbnail float-start me-3 md-max-width-33"
src="{{ $thumbnailResized.RelPermalink }}"
alt="Thumbnail of {{ .Title }}"
/>
{{ end }}