Theme: Fix robots partial "isset on nil" warning
As not all pages have the robots param defined, we got a warning: WARN calling IsSet with unsupported type "invalid" (<nil>) will always return false. This is solved by adding an additional "isset" check.
This commit is contained in:
parent
e0c46fb4e2
commit
63d3f4459d
|
@ -1,5 +1,5 @@
|
||||||
{{ $robotsGenerate := false -}}
|
{{ $robotsGenerate := false -}}
|
||||||
{{- if or (isset $.Params.robots "index") (isset $.Params.robots "follow") }}
|
{{- if and (isset $.Params "robots") (or (isset $.Params.robots "index") (isset $.Params.robots "follow")) }}
|
||||||
{{- $robotsGenerate = true -}}
|
{{- $robotsGenerate = true -}}
|
||||||
{{- else if or (isset $.Site.Params.robots "index") (isset $.Site.Params.robots "follow") -}}
|
{{- else if or (isset $.Site.Params.robots "index") (isset $.Site.Params.robots "follow") -}}
|
||||||
{{- $robotsGenerate = true -}}
|
{{- $robotsGenerate = true -}}
|
||||||
|
|
Loading…
Reference in a new issue