mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2026-11-22 12:39:04 +00:00
fix(images): process webp on standard hugo edition
ref: https://github.com/gohugoio/hugo/releases/tag/v0.153.0
This commit is contained in:
3 files changed
+3
-12
No files matched your search
@@ -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 -}}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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))) }}
|
||||
|
||||
Reference in new issue
Block a user