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 changed files with 1 additions and 1 deletions
				
			
		|  | @ -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 -}} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue