🐛 fix disableImageOptimization usage across all images in theme

This commit is contained in:
Nuno Coração
2023-01-05 18:23:21 +00:00
parent db8b13fe43
commit 41f90d20a5
16 changed files with 85 additions and 16 deletions
+9 -2
View File
@@ -1,3 +1,4 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ with .Params.externalUrl }}
<a href="{{ . }}" target="_blank" rel="external" class="min-w-full">
{{ else }}
@@ -13,8 +14,14 @@
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ with .Fill "600x600" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ if $disableImageOptimization }}
{{ with . }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Fill "600x600" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}