diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index d828f120..10baff41 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -12,6 +12,7 @@ autoSwitchAppearance = true enableSearch = true enableCodeCopy = true enableImageLazyLoading = true +enableWebp = true # robots = "" fingerprintAlgorithm = "sha256" diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 699b3f25..cbd84eba 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -2,6 +2,7 @@ {{ $altText := .Text }} {{ $caption := .Title }} {{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }} +{{ $webp := $.Page.Site.Params.enableWebp | default true }} {{ if findRE "^https?" $url.Scheme }}
- {{ if ne .MediaType.SubType "svg" }} + {{ if (and (ne .MediaType.SubType "svg") $webp) }}