Fixed empty header_image param
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user