added multiple options to display hero images

This commit is contained in:
Nuno Coração
2022-10-16 16:49:52 +01:00
parent c14de64d8d
commit 95796f56f2
25 changed files with 226 additions and 27 deletions

View File

@@ -0,0 +1,8 @@
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ with .Resize "1200x" }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- end -}}