Revert "🐛 fix disableImageOptimization usage across all images in theme"

This reverts commit 9cab78a325.
This commit is contained in:
Nuno Coração
2023-01-05 20:51:11 +00:00
committed by GitHub
parent 4453e4add3
commit 5e941be600
16 changed files with 16 additions and 85 deletions
+3 -13
View File
@@ -1,5 +1,3 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*background*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "*feature*" }}{{ end -}}
@@ -15,21 +13,12 @@
(and ($.Site.Params.list.layoutBackgroundHeaderSpace | default true) ($isParentList))
) }}
{{- with $featured -}}
{{ with .Resize "1200x" }}
{{ if $shouldAddHeaderSpace | default true}}
<div id="hero" class="h-[150px] md:h-[200px]"></div>
{{ end }}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
{{ end }}
{{ end }}
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
</div>
<div
@@ -46,4 +35,5 @@
});
</script>
{{ end }}
{{ end }}
{{- end -}}