From 159dd8f5f199c121e4e617269cc346256119acc1 Mon Sep 17 00:00:00 2001 From: Joe Hutchinson Date: Sun, 20 Jan 2019 22:12:32 -0500 Subject: [PATCH] Include webp image format through shortcode and featuredimage --- layouts/_default/single.html | 8 ++++++-- layouts/shortcodes/image.html | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 layouts/shortcodes/image.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d5d7619..8f49742 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,9 +10,13 @@

Posted

{{ if isset .Params "featuredimage" }} -
+ + {{ if (fileExists (printf "%s/%s" "static" (replace (.Params.featuredimage) (path.Ext (.Params.featuredimage)) ".webp"))) -}} + + {{- end }} + -
+ {{ end }} {{ .Content }} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html new file mode 100644 index 0000000..d7c0c10 --- /dev/null +++ b/layouts/shortcodes/image.html @@ -0,0 +1,5 @@ + + + + {{ index .Params + \ No newline at end of file