From 63d3f4459dc2e5f65fced24859eabdb1d7982dc9 Mon Sep 17 00:00:00 2001 From: jtbx Date: Wed, 17 Apr 2024 20:21:22 +0200 Subject: [PATCH] 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" () will always return false. This is solved by adding an additional "isset" check. --- themes/ccchh/layouts/partials/robots.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/ccchh/layouts/partials/robots.html b/themes/ccchh/layouts/partials/robots.html index 818e591..baf56ac 100644 --- a/themes/ccchh/layouts/partials/robots.html +++ b/themes/ccchh/layouts/partials/robots.html @@ -1,5 +1,5 @@ {{ $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 -}} {{- else if or (isset $.Site.Params.robots "index") (isset $.Site.Params.robots "follow") -}} {{- $robotsGenerate = true -}} -- 2.44.2