Resize images on list page to thumbnail size

This commit is contained in:
Joe Hutchinson
2019-07-20 12:08:27 -04:00
parent e4fbd4e123
commit ad2b26e80b

View File

@@ -6,8 +6,9 @@
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
<source srcset="{{ .Permalink }}" type="image/webp">
{{- end }}
<source srcset="{{ .Permalink }}">
<img src="{{ .Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
{{ $thumbnail := .Fit "400x300 Lanczos" }}
<source srcset="{{ $thumbnail.Permalink }}">
<img src="{{ $thumbnail.Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
</div>
{{- end }}