Include webp image format through shortcode and featuredimage
This commit is contained in:
5
layouts/shortcodes/image.html
Normal file
5
layouts/shortcodes/image.html
Normal 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>
|
||||
Reference in New Issue
Block a user