add default background image to theme

This commit is contained in:
madoke
2022-11-13 23:28:38 +00:00
parent b27d78945c
commit 0219bb263c
3 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{- with $featured -}}
{{ with .Resize "1200x" }}
<div id="hero" class="h-[150px] md:h-[200px]"></div>
@@ -23,4 +24,4 @@
</script>
{{ end }}
{{ end }}
{{- end -}}
{{- end -}}