Include webp image format through shortcode and featuredimage

This commit is contained in:
Joe Hutchinson
2019-01-20 22:12:32 -05:00
parent 3bfd421d6b
commit 159dd8f5f1
2 changed files with 11 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
<picture>
<source srcset="{{ replace (index .Params "src") (path.Ext (index .Params "src")) ".webp" | absURL }}" type="image/webp">
<source srcset="{{ index .Params "src" | absURL }}">
<img src="{{ index .Params "src" | absURL }}" {{ if isset .Params "alt" -}} alt="{{ index .Params "alt"}}" {{- end }}>
</picture>