Theme: Fix robots partial "isset on nil" warning #57

Merged
c6ristian merged 1 commit from fix/isset-warning into main 2024-04-20 18:15:05 +02:00

View file

@ -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 -}}