Fixed empty header_image param

This commit is contained in:
2020-10-18 21:12:33 +02:00
parent 3d225a0e9a
commit 079b7b7c2b
903 changed files with 11 additions and 76822 deletions
+10 -5
View File
@@ -19,10 +19,15 @@
{{/* Defined as params */}}
{{ if isset .context.Params .name }}
{{ $image_name := .context.Param .name }}
{{ with .context.Resources.GetMatch $image_name }}
{{ $headerImage = . }}
{{ end }}
{{/* param exist and is not zero */}}
{{ if .context.Param .name }}
{{ with .context.Resources.GetMatch ( .context.Param .name ) }}
{{ $headerImage = . }}
{{ end }}
{{ end }}
{{ end }}
@@ -46,4 +51,4 @@
{{/* return either a Resource, or an empty string. Note that partials can only have a single
return statement, so this needs to be at the end of the partial (and not in the if block) */}}
{{ return $headerImage }}
{{ return $headerImage }}