added multiple options to display hero images

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

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ with .Resize "1200x" }}
<div id="hero" class="relative h-[45vh] single_hero_background nozoom" style="background-image:url({{ .RelPermalink }});">
<div class="hero_gradient bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
</div>
{{ end }}
{{- end -}}