From 8919e487b51123ac0ec903079fecbade1594e341 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:05:28 +0530 Subject: [PATCH] fix(images): process webp on standard hugo edition ref: https://github.com/gohugoio/hugo/releases/tag/v0.153.0 --- layouts/_partials/cover.html | 5 +---- layouts/_partials/header.html | 5 +---- layouts/_partials/index_profile.html | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/layouts/_partials/cover.html b/layouts/_partials/cover.html index 9c1f9eaa..460e490e 100644 --- a/layouts/_partials/cover.html +++ b/layouts/_partials/cover.html @@ -14,10 +14,7 @@ {{- /* If we have the image in pageBundle or globalResources we can process the image */}} {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} - {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} - {{- if hugo.IsExtended -}} - {{- $processableFormats = $processableFormats | append "webp" -}} - {{- end -}} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif" "webp") -}} {{- $imgdl := (.Params.cover.image) | absURL }} {{- if $cover -}} diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html index 311f1d50..23d4b04b 100644 --- a/layouts/_partials/header.html +++ b/layouts/_partials/header.html @@ -7,10 +7,7 @@ {{- if site.Params.label.icon }} {{- $img := resources.Get site.Params.label.icon }} {{- if $img }} - {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} - {{- if hugo.IsExtended -}} - {{- $processableFormats = $processableFormats | append "webp" -}} - {{- end -}} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif" "webp") -}} {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} {{- if site.Params.label.iconHeight }} diff --git a/layouts/_partials/index_profile.html b/layouts/_partials/index_profile.html index 6882f39b..88567d4f 100644 --- a/layouts/_partials/index_profile.html +++ b/layouts/_partials/index_profile.html @@ -7,10 +7,7 @@ {{- $img = resources.Get .imageUrl }} {{- end }} {{- if $img }} - {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} - {{- if hugo.IsExtended -}} - {{- $processableFormats = $processableFormats | append "webp" -}} - {{- end -}} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif" "webp") -}} {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} {{- if (not (and (not .imageHeight) (not .imageWidth))) }}