Resize featured images to reduce file size

This commit is contained in:
Joe Hutchinson
2019-07-20 20:12:50 -04:00
parent ad2b26e80b
commit 0a27447f4b

View File

@@ -14,8 +14,9 @@
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
<source srcset="{{ .Permalink }}" type="image/webp">
{{- end }}
<source srcset="{{ .Permalink }}">
<img src="{{ .Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
{{ $featured := .Resize "800x Lanczos" }}
<source srcset="{{ $featured.Permalink }}">
<img src="{{ $featured.Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
{{ end }}
{{ .Content }}